Jump to content
Sign in to follow this  
Sam31

How to valid first later of a text?

Recommended Posts

Sam31

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?

Share this post


Link to post
Share on other sites
Mikeman27294

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.