Sign in to follow this  
Followers 0
rimba

compare character string

6 posts in this topic

howto compare the first three character of string with three character for example ABC.

regards

Share this post


Link to post
Share on other sites



Have a look in the help file at

StringCompare()


Share this post


Link to post
Share on other sites

could you send me an example of character compare or matching?

regards

Share this post


Link to post
Share on other sites

could you send me an example of character compare or matching?

regards

Open your help file and look for these bolded function names in the index of your help file (will have their own examples other than below):

$var1 =StringLeft("var or string here", 3)

$var2 = StringLeft("var or string here", 3)

MsgBox(64, "Info", "String is equal = " & (StringCompare($var1, $var2) == 0))


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

regards

:mellow:

I don't know what kind of comparisons you're trying to do, but StringCompare() really should be used if you're trying to find out which string is greater/lesser than the other.

If you're just trying to compare ABC to abc and you want it case sensitive: $var1 == $var2 would suffice, if you didn't want it case sensitive, $var1 = $var2 would do the trick as well (With StringLeft("string", 3) as as the var values).

Might save yourself some time and look up Operators in the help file as well :( ...


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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