1 Feb 2010 at 20:45 #1 lixxus lixxus 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()
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()
1 Feb 2010 at 21:02 #2 topbanana topbanana Associate Joined 15 Jun 2005 Posts 630 Look up what InStr() does
1 Feb 2010 at 21:04 #3 lixxus lixxus Soldato OP Joined 20 Oct 2006 Posts 2,595 Location London already did that before didnt get it The InStr function returns the position of the first occurrence of one string within another.
already did that before didnt get it The InStr function returns the position of the first occurrence of one string within another.
1 Feb 2010 at 21:05 #4 topbanana topbanana Associate Joined 15 Jun 2005 Posts 630 So what value must x have in order for InStr to return 2?
1 Feb 2010 at 21:08 #5 lixxus lixxus Soldato OP Joined 20 Oct 2006 Posts 2,595 Location London is the answer "e" you count 2 from W|e|lcome
1 Feb 2010 at 21:14 #6 radderfire radderfire Soldato Joined 24 Sep 2007 Posts 5,596 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
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
1 Feb 2010 at 21:16 #7 lixxus lixxus Soldato OP Joined 20 Oct 2006 Posts 2,595 Location London yeah i get it. thanks guys.