====Message 1 ====
hi mate. How to solve this problem.. I think we need to declare two arrays.. Pop of 1st array should be push for 2nd array .. But cant implement it. Please help.
====Message 2 ====
while searching on google. I found this .. Kerry D. Wong » Blog Archive » Three Ways to Reverse a String in C# .. But really cant understand anything
====Message 3 ====
Is this correct.. ?
[HIGHLIGHT="C#"]Public void pop()
{
Console.WriteLine("popped item :" + firstarray[top]);
For (int i = 0 ; i<array_size ; i++)
Secondarray[i]=firstarray[top];
Top--;
}
[/HIGHLIGHT]
I think FOR loop is not needed because overflow and underflow will be check on another function by bool
[HIGHLIGHT="C#"]Public void pop()
{
Console.WriteLine("popped item :" + firstarray[top]);
Secondarray[i]=firstarray[top];
Top--;
}[/HIGHLIGHT]
Last edited by nt_virus; 02-23-2008 at 08:00 PM.
I am wondering if you would want somthing like this
String str = "Hello This Is My String";
you can use the Split() to split at a char
it will return a string array and you can use somthing like string builder to rebuild how you would like.
char delimiter = ' ';
String[] temp = str.Split(delimiter);
Now temp holds each word in the a diffrent array place;
temp[0] = "Hello"
temp[1] = "This"
temp[2] = "Is"
temp[3] = "My"
temp[4] = "String"
Im not to familar with string builder off hand right now but i know u can concatanate string and then u can just use a for loop running backwards to reverse the order.. I am sure there is an easier way though.
for(int i = temp.Count - 1; i >= 0; i--
{
Or somthing along thoes lines
}
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks