I am trying to use the pub.string.replace service to modify only the first
occurrence of a string but am having no luck figuring out the regular expression (searchString).
I would like to invoke the service on this string (inString):
‘String1 String2 String1 String2’
and want it to look like:
‘String1 String2Replaced String1 String2’
Note that I only want to change the first occurrence of ‘String2’ with ‘String2Replaced’ (replaceString).
Any help would be greatly appreciated.