Syntax :
Mid ( strResultString , ingStart [ , ingLength ] ) = strExpression
MidB ( strResultString , ingStart [ , ingLength ] ) = strExpression
strResultString : String in which you want to replace a substring with another substring.
ingStart : Starting position for the replacement
ingLength : Number of characters of the substring to be replaced
strExpression : Replacement value for the substring
Mid ( strResultString , ingStart [ , ingLength ] ) = strExpression
MidB ( strResultString , ingStart [ , ingLength ] ) = strExpression
strResultString : String in which you want to replace a substring with another substring.
ingStart : Starting position for the replacement
ingLength : Number of characters of the substring to be replaced
strExpression : Replacement value for the substring
Dim strHello as String
strHello = "Hello, Dolly"
Mid ( strHello , 1 , 5 ) = "Oh my"
Mid ( strHello , 8 ) = "Beck"
The first example replaces "Hello" in strHello with "Oh my". The second example starts at the eighth position and replaces whatever text is there with "Beck". Because the length is not specified , the replacement is effective for the length of "Beck". This makes strHello's final value "Oh my, Becky"
strHello = "Hello, Dolly"
Mid ( strHello , 1 , 5 ) = "Oh my"
Mid ( strHello , 8 ) = "Beck"
The first example replaces "Hello" in strHello with "Oh my". The second example starts at the eighth position and replaces whatever text is there with "Beck". Because the length is not specified , the replacement is effective for the length of "Beck". This makes strHello's final value "Oh my, Becky"
No comments:
Post a Comment