Jump to content

How to check if a string has white spaces


Recommended Posts

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

Link to post
Share on other sites
  • Developers

$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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

    No registered users viewing this page.

×
×
  • Create New...