Skip to main content

Hello - I am trying to build a string that converts Full Name to Username. For example I have John Smith in a field and would like to extract jSmith. What should be the correct syntax?

Hi,

If you use a combination of a Regular expression to split based on space character and then fn-Substring('your text',1,1) to get the first character in a Build string action you should be fine.

Jan


Use Regular expression action:

^(.)[^ ]* (w+)$

  • ^ assert position at start of the string
  • 1st Capturing group (.)
    • . matches any character (except newline)
  • [^ ]* match a single character not present in the list below
    • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
    • the literal character
  • matches the character literally
  • 2nd Capturing group (w+)
    • w+ match any word character [a-zA-Z0-9_]
      • Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
  • $ assert position at end of the string

Works flawlessly!!! Thanks!


Reply