Hi Friends, I want to split the string in ASP.NET 2.0 using the C#.
For example, the input string to text box is:
S:NewYork D:Washington.
The string must start with "S:" , it identifies the source city , and destination city identified by "D:" both separated by blank space.
The output should be
Source is "NewYork"
Destination is "Washington"
The code should remove "S:" and give source city then remove blank space then remove "D:" and give the destination.
I tried to use String.Split() and String.Trim() but not able to do it well.
Please any one can help?
For example, the input string to text box is:
S:NewYork D:Washington.
The string must start with "S:" , it identifies the source city , and destination city identified by "D:" both separated by blank space.
The output should be
Source is "NewYork"
Destination is "Washington"
The code should remove "S:" and give source city then remove blank space then remove "D:" and give the destination.
I tried to use String.Split() and String.Trim() but not able to do it well.
Please any one can help?