find the length of the string without using length function?

Answers were Sorted based on User's Feedback



find the length of the string without using length function?..

Answer / rajanikanth

Option Explicit
Dim a
txt="I am Rajanikanth"
txt = txt & "@"
a = Instr(txt, "@") - 1
MsgBox a

Is This Answer Correct ?    3 Yes 0 No

find the length of the string without using length function?..

Answer / prudviraj

str= "this is an interview questions"
var1= Right(str,1)
var2 = InStrRev(str,var1)
MsgBox var2

Is This Answer Correct ?    0 Yes 0 No

find the length of the string without using length function?..

Answer / cnu_thatavarthi

Option Explicit
Dim strValue,iCount, intcounter

strValue = "thatavarthi"
intcounter = 0
for icount = 1 to len(strValue)
intcounter = intcounter+1

Next
Msgbox intcounter

'Expected Value
---------------------------

---------------------------
11
---------------------------
OK
---------------------------

Is This Answer Correct ?    0 Yes 0 No

find the length of the string without using length function?..

Answer / rajani_kanth

Option Explicit
Dim a,text
text="I am Rajanikanth"
text=text&"@"
a=InStr(text,"@")-1
MsgBox a

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

write a vb script to generate the following pattern ***** **** *** ** *

7 Answers   Blue Star,


Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com

1 Answers  


What is the equivalent of VBScript?s On Error In Jscript ?

1 Answers   Microsoft,


What is sql loader? Explain the files used by sql loader to load file?

0 Answers  


Which command is used for writing text on a page?

0 Answers  






Write a Script for ATM in QTP

0 Answers  


How to find arry size in qtp vb script

2 Answers   Cap Gemini,


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

0 Answers   CSC,


Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


Explain about operator precedence in vb script?

0 Answers  


How to map test cases with Automation script? Please explain in details.With example Thanks for your co-operation(In Advance)

1 Answers   Google, IBM,


How to Convert Hex color code to color name in VB Script?

0 Answers  


Categories