Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This probably has to be one of the most annoying yet simple problems I have ever ran across. How do I remove parenthesis from a string in code such as

 


str1 = str2.Text.Replace(" '"' ", "");

 

That does not work because the parenthesis is a keychar.

 

Thanks In Advance.

 

-=Simcoder=-

Whatever thy hand findest to do, do it with all thy heart - Jesus
Posted

Guessing it is C# (well, there is no ; in vb ;) ), you can also use the \ to indicate the use of the " character. So it would be something like:

[CS]

str1 = str2.Text.Replace(" \" ", "");

[/CS]

The \ indicates an escape sequence allows you to specify other characters as well (like linefeed \n, return \r, tab \t, and some more stuff).

Nothing is as illusive as 'the last bug'.
Posted
Its strange how the '"' actually has 2 escape characters, the example I gave also works.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...