how to extract last name?

97 Views Asked by At

Is there a functoid that specializes in splitting a string based on a delimitter?

Let's say I have a Fullname field that looks like so:

Gordon, Liza
Shiksa, Nancy
Shkura, Lola
Sukovich, Matthew

How would I extract last name?

My desired output would look like this:

Gordon
Shiksa
Shkura
Sukovich
1

There are 1 best solutions below

2
Connor On BEST ANSWER

There's no single functoid that will do this. You have two options:

  • Use a script functoid to write a C# method that will parse out the last name
  • Use the String Find, Subtraction, and String Extract functoids to get the last name. This method assumes that each input string always has a comma (,).

Option 2 with 3 functoids: BizTalk Map

String Find Inputs:

  • Input string: Fullname
  • Search string: ,

Subtraction Inputs:

  • Input[0]: String Find
  • Input[1]: 1

String Extract Inputs:

  • Input string: Fullname
  • Start index: 1
  • End index: Subtraction

Connect the output of String Extract to your output element. The subtraction is necessary since BizTalk counts string positions starting at 1 and you don't want the comma part of the output.