Jump to content

check the string from input and remove the space character


Recommended Posts

Link to comment
Share on other sites

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()
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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