Jump to content

Recommended Posts

Posted (edited)

Hi,

Please help me write a short script that checks for space character and remove it.

Thank you for assisting.

Edited by astrax
Posted

StringStripWS($String, 8)

I'm not sure how i'd apply this. I have a text box ($input) asking for user input, the click of a button ($submit) will check the string for space and remove it.

Would it be correct if i write it like this?

case $submit
      StringStripWS($input, 8)
      sub()
Posted

I found a way to do it.. thanks for the code.

Case $Submit
$RmSp = StringStripWS(GUICtrlRead($input), 8)
sub()
Posted

You could also use "StringRepalce ()" here's a little example

Source :

$Replace_Space_With = '{Space}'; This can be anything.
$Input = InputBox ('Name?','Please input your name.')
$Input = StringReplace ($Input, ' ', $Replace_Space_With); Scans $Input for spaces and replaces it with $Replace_Space_With
MsgBox ('0','StringReplace () Example','Before : ' & StringReplace ($Input, $Replace_Space_With, ' ') & @CRLF & 'After : ' & $Input, '0')

Hope this helps! :)

- John

Latest Projects :- New & Improved TCP Chat

Posted

or.. stringsplit($String, ' ') there are a few ways to do this.. i would do John's idea myself though

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
  • Recently Browsing   0 members

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