Hi,
I have this string for example : "Hello-World! Let's talk-about-you!"
If I want to know the number of "-" (here would be 3) into that string, how could I do that with a transformer?
Thanks!
Best answer by takashi
View originalHi,
I have this string for example : "Hello-World! Let's talk-about-you!"
If I want to know the number of "-" (here would be 3) into that string, how could I do that with a transformer?
Thanks!
Best answer by takashi
View originalI'm sure there are a few options, but I would use a StringSearcher and put the matches into a list, then expose the list and count the elements. Like this:
Also FME String Functions might be an option in this case.
Also FME String Functions might be an option in this case.
A more direct expression flashed. Remove every character except hyphens, and then get the length.
@StringLength(@ReplaceRegEx(@Value(str),[^-]+,""))
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.