Visual Basic Question

Soldato
Joined
20 Oct 2006
Posts
2,595
Location
London
im learning some VB online. i dont want to cheat because i want to understand the logic

and im having trouble with this one

What is the value of x?
intNum = InStr(“welcome to the office”,x)

intNum = 2

a) Word()
b) “e”
c) space()
 
already did that before didnt get it

The InStr function returns the position of the first occurrence of one string within another.
 
Yes:

intNum = InStr(“welcome to the office”,"e")

The InStr function will return the position of the first occurrence of:

e

in the string:

welcome to the office

which is position 2.

If you had:

intNum = InStr(“welcome to the office”,"c")

Then:

intNum = 4

Do you follow?

Rgds :cool:
 
Back
Top Bottom