How to find repetition of letters in a word
input : indian
output be like :
i = 2
n=2
d=1
i=1
a=1
Hello Heman,
You can achieve it using string operations and loop action.
Follow the steps:
- Find the length of the given “sInputVariable” as “nStringCount”
- Loop for “nStringCounter” (length of the “sInputVariable”)
- Find substring as (source string: “sInputVariable”, start from: “nCounter” (default value is 1), lenght: 1)
- Assign the output of substring action to a variable “sCharacter”
- Replace the variable occurence “sCharacter” with " " in “sInputVariable” and assign it to “sOccurence”
- Find the length of “sOccurence” as “nCharacterCount”
- Substract “nCharacterCount” from “nStringCount” and assign it to “nCharacter”
- Use message box to display “sCharacter” = “nCharacter”
- Increase the counter variable “nCounter” by 1
1 Like