Friday, 2 August 2013

What are the trim functions in QTP?

Trims functions are used to remove blank spaces from the string.

There are 3 trim functions in QTP as mentioned below.

  1. ltrim     - removes leading (at the beginning) spaces from the string
  2. rtrim     - removes trailing (at the end )spaces from the string
  3. trim       - removes leading and trailing spaces from the string


Example -

print ltrim("  hello Tester   ")
'it will print "hello Tester   "

print rtrim("  hello Tester   ")
'it will print "  hello Tester"

print trim("  hello Tester   ")
'it will print "hello Tester"
'Please note that it does not remove the spaces from the middle 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.