VBA/Excel/Access/Word/String Functions/StrConv

Материал из VB Эксперт
Перейти к: навигация, поиск

StrConv: vbLowerCase

   <source lang="vb">

Sub UsefulStringFunctions()

   Dim sTestWord As String 
   sTestWord = "The moon over Minneapolis is big and bright." 
   Debug.Print sTestWord
   Debug.Print StrConv(sTestWord, vbLowerCase) 

End Sub

</source>
   
  


StrConv: vbProperCase

   <source lang="vb">

Sub UsefulStringFunctions()

   Dim sTestWord As String 
   sTestWord = "The moon over Minneapolis is big and bright." 
   Debug.Print sTestWord
   Debug.Print StrConv(sTestWord, vbProperCase) 

End Sub

</source>
   
  


StrConv: vbUpperCase

   <source lang="vb">

Sub UsefulStringFunctions()

   Dim sTestWord As String 
   sTestWord = "The moon over Minneapolis is big and bright." 
   Debug.Print sTestWord
   
   Debug.Print StrConv(sTestWord, vbUpperCase) 

End Sub

</source>
   
  


vbFromUnicode: Converts the given string from Unicode to the system"s default code page.

   <source lang="vb">

Sub strConv5()

   Debug.Print STRConv("lowerCase", vbFromUnicode)

End Sub

</source>
   
  


vbLowerCase: Converts the given string to lowercase characters.

   <source lang="vb">

Sub strConv2()

   Debug.Print STRConv("lowerCase", vbLowerCase)

End Sub

</source>
   
  


vbProperCase: Converts the given string to propercase (aka title case-the first letter of every word is capitalized).

   <source lang="vb">

Sub strConv3()

   Debug.Print STRConv("lowerCase", vbProperCase)

End Sub

</source>
   
  


vbUnicode: Converts the given string to Unicode using the system"s default code page.

   <source lang="vb">

Sub strConv4()

   Debug.Print STRConv("lowerCase", vbUnicode)

End Sub

</source>
   
  


vbUpperCase: Converts the given string to uppercase characters.

   <source lang="vb">

Sub strConv1()

   Debug.Print STRConv("lowerCase", vbUpperCase)

End Sub

</source>