Micro Focus QTP (UFT) Forums

Full Version: Replace space with %10
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Use split function to bring each word into substrings and then use join function with delimiter %10.
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.
Thanks much Manojith.Replace function worked.
Ya replace is a shorter option.
I think split and join with delimiter %10 should also work. Did you try that?
Hi Ankur,
Split and join function is also an alternative for the problem mentioned.