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

how to write basic programs in VB Script like addition, multiplication?

14 Answers  


how to comvert 120 into one hunderd twenty rupees only and vice varsa

0 Answers  


How to copy from one script to another script in qtp

4 Answers  


I wrote the vbscript code on notepad i was geeting run time error "object required line 1" my code is set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signin("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Setsec ure.Crypt.Encrypt("entr password") browser("gmail").page("gmail").WebButton("siginobj").click pls tell me whats wrong

1 Answers  


how to automatically update the sql server2005 database records when insert in vb6?

0 Answers  


what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

0 Answers   Estuate,


who you define variables and functions in VB?

1 Answers  


Write a program to display the numbers in the below format using for loops? 1 2 3 4 5 6 7 8 9 10 11 12 and Write a program to display the numbers in the below format using for loops. 1 2 3 4 5 6 7 8 9 10

2 Answers  


How to check the particular window is exist or not with out using check points

2 Answers  


am giving to one number u can set into that in date format.u can use any methods

1 Answers   HP,


What is purpose of scripting.filesystemobject class in vbscript?

0 Answers  


How to add actions in driver script to run those actions in QTP?

0 Answers  


Categories