Hi, i have 2 strings that i would like to compare,
The first string called "in_string" is the data being received, in that string is 4 characters, e.g "STID"
The second string is called "STRING" and is in a string manipulation box, STRING = "STID"
OK, so i send my 4 characters STID and it stores them into the array,
After reading posts on the forum the only way i can find to compare them is to compare each character within the array using this.
(in_string[1] =STRING[1]) && (in_string[2] =STRING[2]) && (in_string[3] =STRING[3]) && (in_string[4] =STRING[4])
This works but seems a bit excessive, just dont want to do this if i needed say 10 characters,
So basically, is there a way to compare an entire string in a simpler way?
Comparing Strings
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Comparing Strings
Hi cobra1,
Yes there is a simpler way. You can use the compare() function which is found by clicking on functions of a string calculation box.
This function was discussed here:
http://www.matrixmultimedia.com/mmforum ... 586#p19818
Martin
Yes there is a simpler way. You can use the compare() function which is found by clicking on functions of a string calculation box.
This function was discussed here:
http://www.matrixmultimedia.com/mmforum ... 586#p19818
Martin
Martin