long time ago i had a function i wrote, but no idea where it is and i don't have an environment setup to do it.
simple if you have a boilerplate.
I need the count of occurrences of a string within a string.
I have a delimited string returned by a service and want to count the # of items easily.
newFunc (source_string, string_to_count)
example:
aware_field = 'AA@bb@cc@ddd@eeee@ff@gg@hh'
theNum = newFunc(aware_field, '@') /* returns 7 */
theNum = newFunc(aware_field, 'e') /* returns 4 */
will be much appreciated!
PS _ I know I could do this in a While loop - not interested
can someone write me a quick Java function?
can someone write me a quick Java function?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 139
- Joined: Sat Feb 10, 2018 12:56 am
Re: can someone write me a quick Java function?
would it be
aware_field.count('@')
aware_field.count('@')
Re: can someone write me a quick Java function?
I don’t know what kind of syntax that is, and unsure if that’s valid in aware, but yes that would be it in other languages.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL