Hi all,
How to remove common letters in two strings?
B4X:
dim str1 as string = "GUNA"
dim str2 as string = "MANI"
Here I have two names in string variable, Here in the both names, 'A' and 'N' letter is common.
so I wanna remove those letter. and print remaining letters.
A simple way is to work through one word, letter by letter, and check if the other word contains the letter. Then replace the relevant letter with nothing.
A second way would be to convert each word to a map and count each letter into the map. Then check the two maps against each other.
Regular expressions are very powerful and make complicate parsing challenges much easier. This short tutorial will describe the usage of regular expressions in Basic4android. If you are not familiar with regular expressions you can find many good tutorials online. I recommend you to start with...
CSBuilder is supported by B4A and B4J. There are some differences in the supported properties. A more powerful cross platform alternative: [B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View This sub searches for matches and uses CSBuilder to mark the matches...