Click here to Skip to main content
15,562,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a string
s="siva"
so i want to remove double quotes using splite method
plz help me
Posted

C#
string s = "\"siva\"";
       s = s.Replace("\"", "");
 
Share this answer
 
Comments
Member 10527033 4-Feb-14 5:21am    
i have split a string...in output i have a string with double qoutes...like "siva"
can i do like this
string s="siva";
string v=s.Split('"');
i want result only siva...not "siva" please help me
Karthik_Mahalingam 4-Feb-14 5:26am    
u need using split only ?
Karthik_Mahalingam 4-Feb-14 5:30am    
string s = "\"siva\"";
string[] aray = s.Split(new char[]{'"'}, StringSplitOptions.RemoveEmptyEntries);
s = aray[0];

try to debug using break point and try to understand :)
Member 10527033 4-Feb-14 5:49am    
thank you very much... it is working...
Karthik_Mahalingam 4-Feb-14 5:54am    
:)welcome
use Trim

String = String.Trim('"')

eg:-

C#
string test = "*** Test ***";
string result = test.Trim(charsToTrim);
 
Share this answer
 
Comments
Member 10527033 4-Feb-14 5:37am    
hello karthy thank you for your reply...
but it is giving an error...

here is the problem
string s="siva"; //which is output of a split function
now i want to remove double quotes around the string...
i am a fresher....so kindly help me with detailed example....

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