Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace space with %10
#1
Solved: 10 Years, 9 Months ago
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.
Reply
#2
Solved: 10 Years, 9 Months ago
Use split function to bring each word into substrings and then use join function with delimiter %10.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 10 Years, 9 Months ago
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.
Reply
#4
Solved: 10 Years, 9 Months ago
Thanks much Manojith.Replace function worked.
Reply
#5
Solved: 10 Years, 9 Months ago
Ya replace is a shorter option.
I think split and join with delimiter %10 should also work. Did you try that?
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#6
Solved: 10 Years, 9 Months ago
Hi Ankur,
Split and join function is also an alternative for the problem mentioned.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to press the space bar with send keys method Hari Prasad 5 24,628 06-03-2016, 10:47 AM
Last Post: Vijayaragavan.thangam
  Delete and Replace nodes using vbscript in XML file SweetyChowdhury 0 4,248 04-18-2013, 01:11 PM
Last Post: SweetyChowdhury
  Replace LInes of text with a keyword bjotorres 1 1,962 12-04-2008, 02:59 PM
Last Post: roxer

Forum Jump:


Users browsing this thread: 1 Guest(s)