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

What are class properties?

0 Answers  


When importing an excel file that has several columns each with different number of rows into QTP's Global datatable, how can you count the number of rows in a particular column?

3 Answers   Logica CMG, McGraw Hill,


There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?

1 Answers   eMids,


Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function

0 Answers   Microsoft,


what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com

4 Answers   TCS,


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,


write script to open Gmail.com, and to write script for entering username and password and show whether the result as pass or fail

2 Answers   Thomson Reuters,


i have developed the below QTP script to count the no of items available in the web list "Select a product" in www.bankrate.com and also want to print what are the items??? can any one help me to rectify the below script??? SystemUtil.Run "iexplore.exe","www.bankrate.com" a=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetTOProperty("items count") msgbox a Dim List() ReDim List(a-1) For i = 1 To a List(i-1)=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page ("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetItem(i) Print List(i-1) Next

1 Answers  


What are the rules to name variable in vbscript?

0 Answers  


What is the difference between vbscript and vba?

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,


write a function to read the items from combobox of Flight reservation & save in excel (QTP)??

0 Answers  


Categories