Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi again,

I have this string: strA="40.99", I want to get rid of ".", so I did this strB = strA.Trim("."), but strB still has "40.99". Why is that?

Donald DUCK : YOU ARE FIRED!!!
Posted

Trim trims characters on either the beginning or end of a string. It didn't find a '.' in either the starting or ending character so it didn't trim anything off of the string.

 

Try

strB = strA.Replace(".", "")

That should replace the '.' character with a null character. Be careful, though, as this will replace all occurances of the '.' character.

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...