Friday 2 August 2013

What are the different String functions in QTP?

Here is the list of all string functions in QTP.

String functions to extract the part of the string -

  • left  - gets the specified number of characters from the left side of string
  • mid -gets the specified number of characters from the given position of the string
  • right - gets the specified number of characters from the right side of string

String functions to remove the spaces from the string -

  • ltrim - removes the blank spaces from the left side of the string
  • rtrim - removes the blank spaces from the right side of the string
  • trim  - removes the blank spaces from the left and right side of the string
Other String functions - 

String      - Returns a string of the given length with specified character.
Space     - Returns the empty string with given length
strReverse - Reverses the given string
ucase      - Converst the string to upper case
lcase       - Converts the string to lower case
strComp - Compares 2 strings
replace   -  replaces the given string str1 from input string say str with other string say str2
len - gets the number of characters in given string
split - splits the string into array using given delimiter
join - forms the string from given array elements
cstr - converts the data type of the variable into  String
chr - gets the character corresponding to the given ascii value
Asc - gets the ascii value of the given character.
instr - searches for a substring in a given string and returns the position where the match is found.
InStrRev- searches for a substring in a given string and returns the position where the match is found from the end of the string.

More interview questions and answers on strings in QTP
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.