Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to split string single Quote value

Example The Value 'sd' is not valid value

i required like

The Value --1 value
'sd' ---2nd value
is not valid value---3rd value
how to do
Posted

You can use the native Split method.

http://msdn.microsoft.com/en-us/library/b873y76a.aspx[^]

C#
string example = "The Value 'sd' is not valid value";

string[] returnValues = example.split('\'');
 
Share this answer
 
Comments
Abhi KA 4-Oct-12 8:55am    
thns
not the nicest solution:
C#
string test = "The Value 'sd' is not valid value";
   string[] parts = test.Split('\'');
   if (parts.Length > 2)
   {
      parts[1] = "'" + parts[1] + "'";
      MessageBox.Show("Part1: " + parts[0] + " Part2: " + parts[1] + " Part3: " + parts[2]);
   }
 
Share this answer
 

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