Normalizing Strings in QTP

The NormalizeString function receives a string and returns the equivalent string in a regular expression.

Function NormalizeString(OrgStr)

Dim TempStr

TempStr = Replace(OrgStr, "\", "\\")

TempStr = Replace(TempStr, "*", "\*")

TempStr = Replace(TempStr, "+", "\+")

TempStr = Replace(TempStr, ".", "\.")

NormalizeString = Replace(TempStr, "?", "\?")

End function

msgbox NormalizeString ("a+b*c.d?e")

1 comment:

VikramH said...

Hi,

I am using ALM and QTP 11, can you please let me know how to find the path of resource different files from the ALM Resources folder.

As I am already getting a temp. folder location using PathFinder.Locate function.
BUT I want the server (actual file path) path where the resource files are stored, so that I can refer the same path in ALM it self to access the same.

Thank you in advance for help.
if possible you can send me the same via email also.

Thanks & Regards,
Vikram
vikram.hingwe@gmail.com