Character Occurrences Count
Hello,
I'm wondering if there's a way to count how many times a given character is in a string.
i.e.: I have the field 'mytext' which contains a string (let's say "rockandrollwillneverdie") and I want to find out how many times the letter "e" appears in the string (so the result should be "3".
36 replies
-
And a proposal for the complete computation of the checksum (boy, I had some spare time today, and it rains):
-
https://en.wikipedia.org/wiki/Italian_fiscal_code
I would break down each part (surname, first name, etc) into its own field and calculation and then concatenate all the fields into the fiscal code at the end
-
here's the final code after all the suggestions: from 211 to 35 lines.
-
I suspected that such a convoluted specification could only come from an administration 8-). So, knowing the specification, I am submitting my last word on the subject. As you probably already remarked, I *love* regular expressions. And the computation of the checksum does not use the character counting function, but a simpler and probably more efficient method, despite the fact that this thread was started by a question about character counting.
-
Unless someone knows better, I would declare the parameter to be a "number", and call the function with number(Sesso) as parameter.
-
Hi, sorry to interrupt in this thread, but my case is relevant I think.
Could someone have a look at my thread ?
Seek help to find array position number in a array loop - Get help - Ninox Community
It boils down to count the commas in a string, example image: count the commas to red 00070 without having red 04070 earlier in string messing up the counting.
regards,
Håvard
Content aside
- Status Answered
- 3 yrs agoTue, April 5, 2022 at 10:00 AM UTCLast active
- 36Replies
- 567Views
-
6
Following