Find the length of the string starting with X from the beginning
while ( True ) : NEW_LINE INDENT if ( str [ start ] == X ) : NEW_LINE INDENT xPos = start NEW_LINE break NEW_LINE DEDENT start += 1 NEW_LINE DEDENT