BizTalk - String Functoids

   String Functoids:
    1. If you specify a non-number instead of number, functoid will generate nothing instead of throwing an exception.

String Left Trim: Removes leading spaces from a text item.

Input Data:    Zack Zhao

Output Data: Zack Zhao

Equivalent .Net function:

String sourceString = "   ZackZhao";

Console.WriteLine(sourceString.TrimStart());

String Concatenate: Concatenates a series of input strings.

Input Data: two strings: “Hello!” and “ Zack Zhao”.

Output Data: Hello! Zack Zhao

Equivalent .Net function:

string greeting = "Hello!";

string sourceString = " Zack Zhao";

Console.WriteLine(string.Concat(greeting, sourceString))

Size: Returns, as an integer, the length of a string. Not bytes count.

Input Data: 我是中国人
Output Data: 5

Equivalent .Net function:

 string sourceString = "我是中国人";

 Console.WriteLine(sourceString.Length);

String Left: Returns a specified number of characters from a text item, starting with the leftmost character.

Input Data: “我是中国人” and 2

Output Data: 我是

Equivalent .Net function:

string sourceString = "我是中国人";

Console.WriteLine(sourceString.Substring(0,2));

String Extract: Extracts a string specified by the start and end positions of a super string.

leftmost character.

Input Data: “Zack” , 2 and 2

Output Data: a

Equivalent .Net function

string sourceString = "Zack";

Console.WriteLine(sourceString.Substring(1,1));

Upper Case: Use the Uppercase functoid to convert a text item to uppercase characters. This functoid requires one input parameter.

Input Data: Zack Zhao

Output Data:ZACK ZHAO

Equivalent .Net function:

string sourceString = "Zack Zhao";

Console.WriteLine(sourceString.ToUpper());

Lower Case: Use the Lowercase functoid to convert a text item to lowercase characters. This functoid requires one input parameter.

Input Data: Zack Zhao

Output Data: zack zhao

Equivalent .Net function:

string sourceString = "Zack Zhao";

Console.WriteLine(sourceString.ToLower());

String Right: Use the String Right functoid to return a specified number of characters from a text item, starting with the rightmost character. This functoid requires two input parameters.

Input Data: “我是中国人” and 3

Output Data:中国人

Equivalent .Net function:

string sourceString = "我是中国人";

Console.WriteLine(sourceString.Substring(sourceString.Length-3,3));

String Find: 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.

Input Data: “Zack” and “Z”

Output Data:1

Equivalent .Net function:

string sourceString = "Zack";

Console.WriteLine(sourceString.IndexOf("Z"));

    Note: the position of the first character in a string is 1 not 0, it is different from c#.

你可能感兴趣的:(BizTalk - String Functoids)