Jump to content
Sign in to follow this  
Dracil

Simple Help?, remove specifik letters from a string

Recommended Posts

Dracil

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

Share this post


Link to post
Share on other sites
Lococobra

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.

Share this post


Link to post
Share on other sites
AlmarM

If you a are curious, take a look at my "_StringStripChar" in my sig. ;)


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
Lococobra

No offense, but regular expressions win any day of the week ;)

Share this post


Link to post
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
Sign in to follow this  

×