Sign in to follow this  
Followers 0
Sam31

How to valid first later of a text?

4 posts in this topic

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



#2 ·  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

Share this post


Link to post
Share on other sites

Hey thank you very much!

Share this post


Link to post
Share on other sites

No problems.

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  
Followers 0