Skip to main content

Posts

Showing posts with the label String

VB.Net String Functions in UiPath RPA

String.Concat – Concatenates one or more instances of string or string representation of objects. Expression: String.Concat (VarName1, VarName2) Output datatype: String Contains – Checks whether a specified substring occurs within a string and returns either true or false. Expression: VarName.Contains (“text”) Output datatype: Boolean String.Format – Converts the value of objects to strings and inserts them into another string. Expression: String.Format(“{0} is {1}”, VarName1, VarName2) Output datatype: String IndexOf – Returns the index position of the first occurrence of a specified character or a substring. Expression: VarName1.IndexOf(“a”) Output datatype: Int32 LastIndexOf – Returns the index position of the last occurrence of a specified character or a substring. Expression: VarName1.LastIndexOf("author") Output datatype: Int32 String.Join – Concatenates the elements in a collection using the specified separator and displays them as a String. Expression: String.Join(“|”...

How to get desired characters from a String in Siebel eScirpt

substring() Method Extract desired characters from a String (Length Fixed) var SHRs, SMins, TimeStart = "10:30"; SHRs = TimeStart.substring(0,2); //0: Start, 2: End not included SMins = TimeStart.substring(3,5); Results: SHRs: 10 SMins: 30 -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- Syntax stringVar.substring(start[, end]) start: An integer specifying the location of the beginning of the substring to be returned end: An integer one greater than the location of the last character of the substring to be returned Returns A new string, of length end - start, containing the characters that appeared in the positions from start to end - 1 of stringVar. Usage This method returns a portion of stringVar, comprising the characters in stringVar at the positions start through end - 1. The character at the end position is not included in the returned string. If the end parameter is not used, stringVar.substring() returns the characters fr...

How to Split String through Siebel eScript

I have created a Business Service, which takes single input and split the name based on space return the final values in output arguments. Below is the script: var FullName = Inputs.GetProperty("Full Name"); var NameArray = FullName.split(" "); var FirstName = NameArray[0]; var SecondName = NameArray[1]; var ThirdName = NameArray[2]; Outputs.SetProperty("First Name", FirstName); Outputs.SetProperty("Second Name", SecondName); Outputs.SetProperty("Third Name", ThirdName); How to create Business Service in Siebel

How to create Business Service in Siebel

Create new record in Business Service, provide appropriate name and project. Create new record in Business Service Method, provide appropriate method name. Expand Business Service Method and create new records in Business Service Method Arguments and select Type as Input and Output. Right Click on Business Service name and click on Edit Server Scripts. In Service_PreInvokeMethod write your script. function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if(MethodName == "SET") { var IP = Inputs.GetProperty("in"); //Input Property name defined in Business Service Method Arguments var rep = /(-)/g; IP = IP.replace(rep , ""); Outputs.SetProperty("out", IP); //Output Property name defined in Business Service Method Arguments return (CancelOperation); } return (ContinueOperation); } Save, Compile and Test.

How to remove special character from a string through Siebel eScript

I have created a simple Business Service, which takes single input and check if that string contain "-" and it will remove and return the final value in output argument. Below is the script: var IP = Inputs.GetProperty("in"); var rep = /(-)/g; IP = IP.replace(rep , ""); Outputs.SetProperty("out", IP); How to create Business Service in Siebel