Skip to main content
buddycafe
Known Participant
November 8, 2016
Question

Slice or dispaly Last,First,Middle name where each column has a char limit

  • November 8, 2016
  • 1 reply
  • 793 views

Good morning Adobe community,

Our current forms mapping is setup to display a member's name by the following order. Last,First,Middle in a single field (ie Johnson,Gary S). Where Last,First,Middle have their own column with character limit in our table dictionary. There is only a space between first name and middle.

Char Limits for each column:

Last 80

First 20

Middle 20

I'm trying to break the names apart (similar to slice) and re-display the name in a single field such as: Gary S Johnson. Were each name char limit varies. Is this possible? I appreciate any assistance as this is beyond me.

Phil

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 8, 2016

This is tricky... You can try to split the string with the comma to two parts and then split the second part into words, taking the last item to be the middle name, if it's all-caps, I guess.

buddycafe
buddycafeAuthor
Known Participant
November 8, 2016

try67, In the example name above, Johnson,Gary S

is there a way to write two parts, 1) "Give me everything before the comma and send to field1" and 2) "Give me everything after the comma and send to Field2"? 

try67
Community Expert
Community Expert
November 8, 2016

That resolved my issue. Thank you! I'm new to the infinite things you can do with split().


Not to burst your bubble, but you can do exactly one thing with the split method: Split a string using a delimiter into an array.