Tuesday, August 17, 2010

Visual Basic String Function : String

Purpose : The String function returns a string containing the specified number of the requested character.

Syntax :
String ( lngNumChars, intANSICode )
String ( lngNumChars, strCharacters)

lngNumChars : Number of repeating characters in the returned string
intANSICode : ANSI code of the character to ve repeated in the returned string
strCharacters : String where the first character is the character to be repeated in the returned string

Dim strString as String
strString = String ( 10 , " * " )
strString = String ( 10 , 42 )

Because 42 is the ANSI code for asterisk character , both of these statements return the same value : "**********"

No comments:

Post a Comment