Jump to content
UBot Underground

[SOLVED] Counting commas in a variable


Recommended Posts

Hi all,

 

Let's say I have a variable set as:

 

www.today.com,email@address.com,Kevin

 

How would you go about counting the number of commas present in that variable?

 

I'd simply need a result such as in the example above, of 2.

 

Thanks,

Kev

Link to post
Share on other sites

There must be something more elegant but I came up with this.

clear list(%commas)
add list to list(%commas, $find regular expression(#variable, ","), "Don\'t Delete", "Global")
set(#number of commas, $list total(%commas), "Global")
Edited by ds062692
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...