Partilhar via


Text Functions

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Text Functions

Text Functions

Text Functions - Icon

The Text Functions service provides a set of functions that allow text strings to be manipulated.

This service supports the following requests.

Request Description
IsNullorEmpty Indicates whether the specified string is a null reference. Returns true if the text string is null or empty, else returns false.
Contains Returns a value indicating whether the specified string occurs within this string. Returns true if the searched for text is included in the string text, else false.
EndsWith Determines whether the end of a string matches a specified string. Returns true if the string ends with the specified query text string, using the IgnoreCase comparison option.
IndexOf Reports the index of the first occurrence of a string, or one or more characters, within another string. Returns the position of the first occurrence of the Query text in the String text. The search starts at the StartIndex character position and looks forwards.
Insert Inserts a specified text string at a specified index position of another string. The text is inserted at the StartIndex.
Join Concatenates the Separator text between each element of a specified string array. Results in a single concatenated string. (Opposite of Split).
LastIndexOf Returns the character position of the last occurrence of the specified Query text within another string. The search starts at the StartIndex character position and looks backwards.
Pad Aligns the String text, using the PaddingChar text, using PaddingLeft for the amount on left side and PaddingRight for the right side. (This function is not implemented for use in VPL).
Remove Deletes a specified number of characters from the text string, beginning at the StartIndex position.
Replace Replaces all occurrences of specified text in the text string, with the NewValue text.
Split Returns a Strings text array from the elements of the String text, using the Separator text to delimit the elements. (Opposite of Join).
StartsWith Returns true if the beginning of text matches the specified Query text, else returns false.
Substring Returns the text substring from String text. The substring starts the StartIndex character position and uses Length as the length.
ToLower Returns a copy of the String text converted to lowercase.
ToUpper Returns a copy of the String text converted to uppercase.
Trim Returns a text string after removing all leading (using PreserveLeftSpace) and trailing (using PreserveRightSpace) white-space characters from the String text.

NOTE: Complex string manipulations are not a good use for VPL. If you have a requirement to do a lot of string processing, consider writing a service in C# that does what you want. You can use the code for the Text Functions as a starting point.

 

 

© 2012 Microsoft Corporation. All Rights Reserved.