Contains

String Manipulations with UiPath

String Manipulations with UiPath is very helpful in RPA projects as RPA developers use String data types more often than not. Data handled with UiPath comes in many types and most often it will be either text, numbers, dates and times, lists or tables. Text is one of the most common data type hence knowing about  Data of all kinds is stored in variables and used in Visual Basic expressions to configure activities. All activity properties have predefined types and expect expression values accordingly. Most of the variables used with UiPath will fit into one of the following categories:

Scalar variables: These will be holding a single value of a fixed type, for example Characters, Booleans, Numbers and DateTimes, Collections like Arrays, Lists and Queues.

Non Scalar variables: Inferring from what we learnt above, non-scalar data is data which is not singular. It is a data structure with multiple data points.

As text is basically a sequence of characters, we may understand String as an extended type of a simple collection. Below are some String Manipulations with UiPath.

Contains:

This function is utilized to check whether the substring happens inside a given string or not. It returns a Boolean value based on occurrence of search text. If search string is found, this method returns True. If no match is found, it returns False.
In example given below, we check if test variable contains the value ‘input’. As this is the valid case, we should see True message. ‘Contains’ function is case-sensitive so if there is any mismatch with case, this function will return false.
Contains

EndsWith

EndsWith function will test the end segment of a String. It checks whether one String ends with the characters in another. If it matches, then it returns True value otherwise it returns false. This function call is case-sensitive so the case should match exactly to have positive value returned.

       In our example, we check if given string starts with ‘Doe’. We have our input as ‘John Doe’. With syntax as given below, we’ll get true value as name starts with ‘Doe’.

EndsWith
StartsWith

StartsWith tests the initial segment of a String. It checks whether one String begins with the characters in another. If it matches, then it returns True value otherwise it returns false. This function call is case-sensitive. 

       In our example, we check if given string starts with ‘Jo’. We have our input as ‘John Doe’. With syntax as given below, we’ll get true value as name starts with ‘Jo’.

StartsWith
 Equals

This function determines whether two strings instances are equal or not. ‘Equals’ is case sensitive hence this function returns true value only if both strings have same value as well as same case.
If values are same but case does not match it will still return false value.
Equals

So those were 4 commonly used String Manipulations with UiPath that we found in this article. . In the following article, we will demonstrate some more string activities that are utilized in RPA projects. I trust this article was valuable and I thank you for review it.

Check out our UiPath Orchestrator Installation Tutorials Below:
http://rpamantra.com/2019/03/10/uipath-orchestrator-installation-2/
http://rpamantra.com/2019/03/10/uipath-orchestrator-installation-part-2/