How to swap two strings present in a single line(alphabetic order)?

Posted by Gudevg under C# on 4/6/2012 | Points: 10 | Views : 3134 | Status : [Member] | Replies : 6
Good day all,

I want to swap two strings in a single line based on its alphabetic order. This swapping is only applicable for the Author name not more than that.

Example:

Arun 2012, Gopi 2010, Dinesh 2012. Computer Networks, Tata McGraw Hill. 745:19-22
In this line author names Likely Arun, Dinesh, Gopi have to swap in alphabetical order and saved in a same file for reference.
OUTPUT
Arun 2012, Dinesh 2012, Gopi 2010. Computer Networks, Tata McGraw Hill. 745:19-22

How could it possible to swap exactly the string array?

Note:
Every (Multiple)author name is separated by comma(,) and end with (.) full stop

Deepakkumar G.


Responses

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Yes, using Regex.split() I could separate my Author name individually but it is possible to change the same with in a single line. Arun 2012, Dinesh 2012, Gopi 2010 . Computer Networks, Tata McGraw Hill. 745:19-22

Regards


Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Ok I will try


Regards

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Ji,

I compiled the task. Being thanks for your response

Regards,


Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Mission completed.


Regards,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
First of all i tried it with strPara.SkipWhile(x=>x!='.').ToString(); finally completed with Regex.Match only.


Regards,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Its getting out of time. Will come back with new pobs.

Good bye,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response