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!
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!
I'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),e^-]+,""))
A more direct expression flashed. Remove every character except hyphens, and then get the length.
@StringLength(@ReplaceRegEx(@Value(str),x^-]+,""))
OK great this is exactly what I need.