-1
lst1 = ["carro"]
lst2 = ["carroa", "carrooao"]
How do I check if the word in lst1 exists in any substring of lst2. If it exists delete the excess characters of the word that has the substring, making the string lst2, equal to lst1. Do not use size comparison logic or just play the right value on the other variables. I need the character or substring to be identified to be deleted.
Expected result:
lst2 = ["carro", "carro"]
If you want the result to be three strings it is not easier to copy the contents of the first string?
– Jéf Bueno
If the contents of a
str4 = "carraao"
the result should be"carro"
also?– José Henrique Luckmann
@Joséhenriqueluckmann Yes
– G Mattos
@LINQ No, logic needs to find different characters to be deleted.
– G Mattos
What if they’re out of order? Like, "I believe"
– José Henrique Luckmann
@Joséhenriqueluckmann does not apply, in my case the amendment will always be at the end right.
– G Mattos
Totally non-sense, just do:
str2=str3=str1
:-)– Sidon
@Sidon I think I was unclear, I changed the text of the problem to make more sense to you.
– G Mattos
@Gmattos, just one more question, and if the string doesn’t have all the letters, for example :
carraaa
– José Henrique Luckmann
Ah ok, now is another question, although it remains nonsense. :-)
– Sidon