Using "String Find" Functoid with Special Characters

Problem

You need to find a special character when use the String Find Mapping functoid, such as a (carriage return) or a NL line feed).

Solution

BizTalk provides a String Find functoid: Use the String Find functoid to return the position in a string at which another specified string begins. This functoid requires two input parameters: the string that is being searched through, and the string which is being sought.

Sometimes you need to search a special character, for example, the original string looks like as below:

"This is a testing.
 This is another testing"

The string is a multi-line string, which you only want to get the first line, so you may imagine to use String Find Mapping functoid to return the position of <CR> and then to use String Left Mapping functoid to return the first line. However, you cannot directly input a special character in String Find Mapping functoid!

image

Luckily, there is another functoid named ASCII to Character functoid image to return a character when given an ASCII value as input. You can just input "13" as this functoid's parameter, as below:

image

The final solution should looks like as below:

image