Monday, August 16, 2010

Visual Basic String Function : StrConv

Purpose : StrConv converts a string into the specified format.

Syntax :
StrConv ( strExpression , conversionType )

strExpression : String you want converted
conversionType : Constant indicating the conversion type

1 : vbUpperCase = Uppercases the entire string
2 : vbLowerCase = Lowercase the entire string
3 : vbProperCase = Uppercase the first letter in each word in the string

Dim strOldString as String , strNewString as String
strOldString = "arvind NAHAR"
strNewString = StrConv ( strOldString , vbProperCase )

Result is "Arvind Nahar"

No comments:

Post a Comment