Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to separate a string
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks basanth27 and I agree. Using loops does slow down the scripting language, so you need to be wary.

At the same point to test every character in a string to find numbers is a loop (for next). I found that using RE is most beneficial in a function that you can then reuse whenever necessary by just changing the expression. You only need the loop if you want to return the underlying matching string, which in this example is wanted. Just returning a boolean doesn't need the loop at all and performs extremely quick in QTP.

Quote:available string functions supplied by HP dev

I am not aware of any specific HP string testing. Looks like all VBScript string functions to me of which Regular Expression is built in too. Do you have an example of HP functions?

As with all things in development coding, there are many ways to accomplish the tasks at hand. I have used both methods in the past and have only recently become a RE convert. This is just my way to do the requested job and provide a reusable function because I hate rewriting code over and over.
Reply


Messages In This Thread
How to separate a string - by linhke - 05-28-2010, 03:26 PM
RE: How to separate a string - by guin.anirban - 05-28-2010, 03:50 PM
RE: How to separate a string - by jsknight1969 - 06-04-2010, 01:35 AM
RE: How to separate a string - by basanth27 - 06-07-2010, 02:22 PM
RE: How to separate a string - by jsknight1969 - 06-07-2010, 10:54 PM
RE: How to separate a string - by basanth27 - 06-08-2010, 08:49 AM
RE: How to separate a string - by jsknight1969 - 06-09-2010, 12:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to have a variable that has a string comma string .. shareq1310 5 5,070 11-09-2011, 03:33 PM
Last Post: parminderdhiman84
  string function to get a letter from a string ajay.r1982 3 7,569 06-30-2009, 08:58 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 2 Guest(s)