Micro Focus QTP (UFT) Forums
Replace space with %10 - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Replace space with %10 (/Thread-Replace-space-with-10)



Replace space with %10 - bostonma - 01-31-2009

Hi,

I have to write some code that will replace space in aword with %10.
For ex: "credit card" should be "credit%10card"
How can this be done?Any help plz.

credit card amount is $500.
same has to be turned out as :
credit%10card%10amount%10is%10$500.


RE: Replace space with %10 - Ankur - 01-31-2009

Use split function to bring each word into substrings and then use join function with delimiter %10.


RE: Replace space with %10 - manojith1984 - 02-02-2009

Hi,
Also we can use Replace function:

i.e
Code:
vVal = Replace("credit card amount is $500", "<space>", "%10")

incase if the space is not being recoganized convert the space into ascii value and use it.


RE: Replace space with %10 - bostonma - 02-03-2009

Thanks much Manojith.Replace function worked.


RE: Replace space with %10 - Ankur - 02-03-2009

Ya replace is a shorter option.
I think split and join with delimiter %10 should also work. Did you try that?


RE: Replace space with %10 - manojith1984 - 02-03-2009

Hi Ankur,
Split and join function is also an alternative for the problem mentioned.