VB script Coding with strings. - 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: VB script Coding with strings. (/Thread-VB-script-Coding-with-strings) |
VB script Coding with strings. - Tejas Tikhe - 07-15-2012 Hello, Can anyone please help me in following task. There is paragraph below which is a string. strpara="ABC is good at testing.ABC is working on PC.ABC is playing games." write a code for:- Calculate the occurrences of word “ABC” in the string given above. Thanks. RE: VB script Coding with strings. - ravi.gajul - 07-15-2012 Try this, Code: strng="ABC is good at testing.ABC is working on PC.ABC is playing games." Regards, Ravi RE: VB script Coding with strings. - souvikghosh_diatm - 08-17-2012 I don't think a function is required for this... its as simple as follows which calculate the occurrences as well.... Code: strString = "ABC is good at testing.ABC is working on PC.ABC is playing games." RE: VB script Coding with strings. - ravi.gajul - 08-18-2012 Good one... RE: VB script Coding with strings. - DevilkID - 09-11-2012 Thanks for the script, it's very simple. |