Re: I keep getting this question on beginner study sheets...
From: Tom Dacon (Tom-_at_t-dacons.com)
Date: 06/19/04
- Next message: Tom Dacon: "Re: I keep getting this question on beginner study sheets..."
- Previous message: John Young: "Re: I keep getting this question on beginner study sheets..."
- In reply to: z_learning_tester: "I keep getting this question on beginner study sheets..."
- Next in thread: Tom Dacon: "Re: I keep getting this question on beginner study sheets..."
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Jun 2004 16:22:23 -0700
One approach:
Use String.Split() with a comma as the delimiter, to break up the numeric
substrings into an array. Then iterate over the array from the end to the
beginning, to reassemble the substrings into the order you want. For
example:
HTH,
Tom Dacon
Dacon Software Consulting
"z_learning_tester" <someone@microsoft.com> wrote in message
news:ej2Bc.71373$eu.3683@attbi_s02...
> But I can't seem to find the answer.
> The question is how do you reverse the words in a string?
> Or how do you reverse the numbers listed in a string?
>
> The example is usually something like:
> Turn this string "1,2,3,4,..."
> Into "...4,3,2,1"
>
> This one seems hard enough let alone trying to turn a string of
> space-seperated words around(is that even possible? a trick question
> perhaps?)
>
> Again, any help here much appreciated.
> Thanks!
>
> Jeff
>
>
>
- Next message: Tom Dacon: "Re: I keep getting this question on beginner study sheets..."
- Previous message: John Young: "Re: I keep getting this question on beginner study sheets..."
- In reply to: z_learning_tester: "I keep getting this question on beginner study sheets..."
- Next in thread: Tom Dacon: "Re: I keep getting this question on beginner study sheets..."
- Messages sorted by: [ date ] [ thread ]