Number of special characters in a string.

Shridhar

New Member
Hi All,
Any idea about, how to implement the logic in AA to find the count of special characters in the given string? Awaiting your response. Thanks in advance.
 

Gaurav Sharma

New Member
Hi Shridhar,

I think you can use the "FIND" function in the "String operation" and pass the Special characters those you want to count.

Maybe it can work. :)
 

Shridhar

New Member
FIND sub command only gives you the position of first occurence of the special character so FIND is not a solution i think. Thanks for taking time.
 
HI Sridhar,

You can loop the variable containing the string and compare it using the regular expression if found the special Char increase the count variable.

This might work.
 

Shridhar

New Member
Hi Babjee, i did so, the issue is its not checking the number occurrences of special character in the string instead its simply increasing the count as string contains special character. It went into infinite loop.
Thanks for taking time in answering. Appreciated.
 
HI Shridar, I've tried this it works for all special characters except _(underscore). I can't figure out why it's not taking under score as special character. I used Regex for finding it.
 

Attachments

  • Special Character.JPG
    48.8 KB · Views: 48
Top