Your current approach compares characters in order, which is why it only matches prefixes like "j" or "ja".
If you want to check whether the scrap string contains all the characters needed to form the target name (ignoring order and case, but keeping spaces), you should compare character frequencies instead of positions.