Jump to content

Simple Help?, remove specifik letters from a string


Dracil
 Share

Recommended Posts

Ok ive been searching around, i dunno maybe i just dont know what to search for, but i simply cant find it =/ sorry for asking tho.

But i must know ;)

Ok i have a :

$mystring = "$Mego de"

What i need is something that remove certain letters, here i need to remove the letter "$" and " "(space).

Any tips/gudielines or actual code anyone could provide?

Thanks

Link to comment
Share on other sites

You can do this in one command, and even add more matching characters if you need to.

$mystring = StringRegExpReplace($mystring, '[$\s]', '')

Note that the \s means ANY whitespace character (Horizontal Tab, Line Feed, Vertical Tab, Form Feed, Carriage Return, and the standard space) if you would rather just match the space character then replace \s with a space.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...