Expand|Select|Wrap|Line Numbers
- while (str2.get_Length() != 0) //<---- checks whether second string is "cleared"
- {
- //loop, from start of string (k = 0) to end of string (length2) for (k = 0; k <= length2; k = k + 1)
- {
- char1 = str1.charAt(0);
- y = 0; resets y
- char2 = str2.charAt(0);
- if (char2 == char1) //checks if two are the same, if they are, makes y = point in string with char 2
- {
- y = str2.IndexOf(char2);
- }
- if (y > -1) //checks if y is positive, if so, takes a substring of all other letters
- str2 = (str2.substring(0, y)) + (str2.substring(y + 1));
- }
- }