so I’m trying to make a string similarity app but instead of saying something like 50 or 87.639174, it says +infinity.
how it works is basically, that it first sees if one of the two strings are empty make it either 0 or 100 depending on the situation but it works completely fine, already tested it.
then, it splits the two strings by character to a list with each item being a character or letter, after that it does a for each starting at 1, ending at whatever is bigger the first string or the second, and goes up by 1.
inside the for each if both of the letters it’s in are the same it adds an item to the li list, by the way the true that is added to the list can be any item I just made it true to match the if else, and if the letters it’s in are not the same it adds an item to the il list, also remember li and il are different lists.
finally, it creates the percentage of the similarity of the two textboxes by dividing the amount of items in both lists and multiplying the result to get the percentage of similarity.