06:43
0
VBscript is a scripting language from Microsoft and it is subset of Visual basic Programming language.

Vbscript Has many Stirng functions as the way other programming languages do.

Len :

To have the length of given string.

Syntax - len(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest

StrTest="MastersAutomation"
msgbox Len(StrTest)
'Output  ->17

StrReverse:

Method which is used to get the given string reversed to an specified variable.

Syntax - StrReverse(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="MastersAutomation"
print StrTest
'Output ->"noitamotuasretsam"

UCase:

Method to change the given string to Uppercase

Syntax - Ucase(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="MastersAutomation"
print Ucase(StrTest)
Output-> 'MASTERSAUTOMATION

LCase:

Method to change the given string to Lowercase

Syntax - Lcase(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="MastersAutomation"
print Ucase(StrTest)
Output-> 'mastersautomation

LTrim:

Method Which trims(Removes) the empty spaces From left of the given expression

Syntax - LTrim(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="  MastersAutomation"
print LTrim(StrTest)
Output-> 'MastersAutomation

RTrim:

Method Which trims(Removes) the empty spaces From right of the given expression

Syntax - RTrim(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="MastersAutomation  "
print RTrim(StrTest)
Output-> 'MastersAutomation


Trim:

Method Which trims(Removes) the empty spaces From both left and right of the given expression

Syntax - Trim(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="  MastersAutomation  "
print Trim(StrTest)
Output-> 'MastersAutomation

Space:

Method Which add empty spaces to the given expression

Syntax - Space(String in double Quotes or Variable name in which expression is been assigned)

Example: Dim StrTest
StrTest="MastersAutomation"
print Space(StrTest)
Output-> 'MastersAutomation  .

Left:

Method Which takes the specified number of characters from left of the given expression

Syntax - Left(String in double Quotes or Variable name in which expression is been assigned,No of characters that you want)

Example: Dim StrTest
StrTest="MastersAutomation"
print Left(StrTest,7)
Output-> 'Masters


Right:

Method Which takes the specified number of characters from Right of the given expression

Syntax - Right(String in double Quotes or Variable name in which expression is been assigned,No of characters that you want)

Example: Dim StrTest
StrTest="MastersAutomation"
print Right(StrTest,10)
Output-> 'Automation


Mid:

Method Which takes the specified number of characters anywhere from the given expression

Syntax - Mid(String in double Quotes or Variable name in which expression is been assigned,Character Position of your String and from which you want to begin with,No of characters that you want from the given position)

Example: Dim StrTest
StrTest="MastersAutomation"
print mid(StrTest,1,7)
Output-> 'Masters



String:

Method which returns a specified character for number of times specified.

Syntax - String(No of times you want return a given char,The expression being returned)

Example:
print Space(3,"$")
Output-> '$$$



Replace:

Method Which replaces the existing string with a new string from the given expression

Syntax - Replace (A String from which the a existing string to be found and replaced with new string,Find String,Replace String)

Example: Dim StrTest
StrTest="MastersAutomation"
print Replace(StrTest,"Masters","Student")
Output-> 'StudentAutomation


StrComp:

Method Which Compares two given expression and returns the integer value.

Syntax - StrComp (String 1,String 2,Compare[1 or 0])

Comparison - 0 for binary comparison , 1 for textual comparison

Example: Dim StrTest,StrTest1
StrTest="MastersAutomation"
StrTest1="MastersAutomation"
print strcomp(StrTest, StrTest1,1)
Output-> '0


Split:

Method Which splits the given string by the delimiter given.

Syntax - Split (String ,Delimiter)

Default delimiter would be space character 

Example: Dim StrTest
StrTest=Split("Masters,Automation",",")

print StrTest(0)
Output-> 'Masters


Join:

Method Which Join the given array by the delimiter given.

Syntax - Join (array ,Delimiter)

Default delimiter would be space character 

Example: Dim StrTest
StrTest=Split("Masters,Automation",",")

print Join(StrTest,",")
Output-> 'MastersAutomation


0 comments:

Post a Comment