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).
using pub.string.substring built-in service to extract the value from the input string and map the result into pub.string:replace (search string) and enter the replace string value…its simple.