In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Count the number of occurrences of a specific character in a string

oracleoftemple
9 - Comet

All I'm trying to do it count the number of times a specific character (a pipe) occurs in a string.  Can someone help me with this?

3 REPLIES 3
binu_acs
21 - Polaris

@oracleoftemple One way of doing this with the REGEX_CountMatches function

REGEX_CountMatches([Text], '\|')

 

binuacs_0-1680100065189.png

 

ShankerV
17 - Castor

Hi @oracleoftemple 

 

One way of doing this.

 

REGEX_CountMatches([Field1],'\|')

 

ShankerV_0-1680100223066.png

 

 

Many thanks

Shanker V

newtum
5 - Atom

Here I have written a Python program to count the number of occurrences of a specific character in a string -https://blog.newtum.com/count-the-number-of-occurrences-of-a-character-in-a-string-in-python/

Labels
Top Solution Authors