Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
we are removing quotations of a search string in textbox.
But i want to insert text in search string.


that is if my search string is like "business adminstration".
It has divide as two words and insert with (space and space).
That is like to replace my string as business(space and space)adminstration.
Posted
Comments
Sandeep Mewara 30-May-11 5:44am    
Not clear. Please edit and re-phrase. Use 'Improve Question' link.

1 solution

I think the easy solution is to.

C#
string search = "\"business adminstration\"";
search = search.Replace("\"", string.Empty);
search = search.Replace(" ", " and ");

Console.WriteLine(search);


Output:

business and adminstration

Or perhaps work with regular expression.
 
Share this answer
 
Comments
Shahin Khorshidnia 30-May-11 5:52am    
Good (+5)
Kim Togo 30-May-11 6:12am    
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