Count number of given character in a string

0
Hi Guys,   I want to find the count of given character in a string. Could you please guide me here to implement this. Example : String = ‘Apple’ Character = ‘p’ Then the count of ‘p’ in a given string is 2.     Thanks in advance
asked
2 answers
2

Hi Abrar,

 

Unfortunately, there is not an out-of-the-box functionality for this. you can try length(replaceAll($myString, ‘[^{myLetter}]’, ‘’)). Using your example it would look like length(replaceAll(‘Apple’, ‘[^pP]’, ‘’))

answered
0

find the character index in  java code at broswer  then implement in java action

answered