Jump to content
Sign in to follow this  
Wb-FreeKill

How to check if a string has white spaces

Recommended Posts

Wb-FreeKill

How can i check if this variable has white spaces?

$Var = "Hello There How Are You"

If (variable has no white spaces) Then

Msgbox(0,"test","No White spaces")

EndIf

If (variable has white spaces) Then

Msgbox(0,"test","This variable has white spaces")

EndIf

Share this post


Link to post
Share on other sites
Jos

$Var = "Hello There How Are You"
If StringInstr($var," ") then
    Msgbox(0,"test","This variable has white spaces")
Else
    Msgbox(0,"test","No White spaces")
EndIf


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Wb-FreeKill

$Var = "Hello There How Are You"
If StringInstr($var," ") then
    Msgbox(0,"test","This variable has white spaces")
Else
    Msgbox(0,"test","No White spaces")
EndIf

<{POST_SNAPBACK}>

hmm, that was to easy, thx :)

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  

×