Sign in to follow this  
Followers 0
Tormiasz

StringRegExpReplace question

2 posts in this topic

Hello!

I have this code:

$aFile = StringRegExpReplace($aFile, " = ", "=") ; Delete non-needed spaces
$aFile = StringRegExpReplace($aFile, " - ", "-") ; Delete non-needed spaces
$aFile = StringRegExpReplace($aFile, " / ", "/") ; Delete non-needed spaces
$aFile = StringRegExpReplace($aFile, " + ", "+") ; Delete non-needed spaces

Is there any fast way to make it just into one command?

Greetings

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$aFile = "aaa  = bbb /  ccc+ ddd   - eee"
$aFile = StringRegExpReplace($aFile, '\s*([=/+-])\s*', "$1") ; Delete non-needed spaces
Msgbox(0,"", $aFile)

But you should have a look at StringStripWS   :)

Edited by mikell

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  
Followers 0