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 any ttest cases using check points and parameterization

0 Answers  


write a program to display the system specifications of client system with the help of vbScript.

0 Answers  


Difference between Function and Sub routine?

0 Answers   Polaris,


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

0 Answers  


Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  






Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.

0 Answers  


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

0 Answers  


How to generate 3 digit random number?

3 Answers   IBM, Virtusa,


How will you reverse a string in vbscript?

0 Answers  


what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?

4 Answers   Perot Systems,


Explain about operator precedence in vb script?

0 Answers  


what is test scenario?

1 Answers  


Categories