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 test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

0 Answers  


Write a Script for ATM in QTP

0 Answers  


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

1 Answers  


How to search word in a string without using instring function?

1 Answers   CSS Corp,


How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?

6 Answers   Nous,






how to acces the remote mechine using vb cript(QTP)

0 Answers   TCS,


VBscript for QTP,best tutorial?

2 Answers   Wipro,


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  


1)How to test whether items in a weblist are in alphabetical order or not?

1 Answers   TCS,


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

1 Answers  


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

0 Answers   College School Exams Tests,


What is the scope of a constant declared using public?

0 Answers  


Categories