Jump to content

Recommended Posts

Posted

Hi I'm new with AutoIt script so I just have simple question.

How can I validate the first caracter of a text?

For Exemple:

text = apple

This is what I want:

If first letter of text contain "a" then do X

else do Y

:))) Look simple no?

Posted (edited)

Well that's pretty simple.

$Text = "Apple"
If StringLeft($Text, 1) = "a" Then
    ;Do X
Else
    ;Do Y
EndIf

I don't know what you are doing, but it might pay off for you to take a look at some of the other string functions in the help file.

Enjoy.

Edited by Mikeman27294

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
×
×
  • Create New...