Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My string is
string1--->string2--->string3--->string4--->string5

how to get the string "string1--->string2--->string3--->string" only
Posted

Here[^] is a link about string manipulation in C#. By the time you understand the concept, I'm sure you'll figure out what method to use. Good luck.
 
Share this answer
 
Its not a good question to ask here. You should learn about C# or VB.Net string manipulation. There are many ways to achieve this.

BTW here is one
C#
string str="string1--->string2--->string3--->string4--->string5";
str.Substring(1, str.LastIndexOf(">") - 5);
 
Share this answer
 
Comments
Espen Harlinn 4-Aug-11 4:36am    
Nice and simple, my 5
Suresh Suthar 4-Aug-11 4:40am    
Thanks Espen.
Tech Code Freak 4-Aug-11 6:51am    
my 5 too!
Suresh Suthar 4-Aug-11 6:56am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900