Explain the usage of thse prameters Split, Mid, instr?

Questions by mehboobquazi

Showing Answers 1 - 3 of 3 Answers

fsuhail

  • Feb 17th, 2007
 

SPLIT
-------
Returns a zero-based, one-dimensional array from a specified number of substrings

Example:

dim sstr as string
dim arr() as Array

sstr="My name is Harry"

arr()=split(sstr)


'arr() will contain the substrings as {"My","name","is","Harry"}


MID
-----
Returns a specified number of characters from a string


Mid(str,start,length)
str->given string
start->starting position of the characters to return
length->number of characters to return


Example:


dim sstr as string
dim midstr as string

sstr="My name is Harry"

midstr=mid(sstr,4,4)


'midstr will contain the characters as "name"


INSTR
-------
Returns an integer specifying the start position of the first occurence of one string within another

INSTR(start,str1,str2)


Example:

dim sstr as string
dim searchstr as string
dim pos as integer


sstr="FFFaaaFAAAaa"
searchstr="a"

pos=instr(1,"FFFaaaFAAAaa","a")


'pos will contain result as 4. The first occurence of letter "a" from the start is at position 4.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions