String case: Difference between revisions
Content deleted Content added
{{header|Visual Basic}} |
|||
Line 2,529: | Line 2,529: | ||
MyWord = UCase("alphaBETA") ' Returns "ALPHABETA" |
MyWord = UCase("alphaBETA") ' Returns "ALPHABETA" |
||
MyWord = LCase("alphaBETA") ' Returns "alphabeta"</lang> |
MyWord = LCase("alphaBETA") ' Returns "alphabeta"</lang> |
||
=={{header|Visual Basic}}== |
|||
{{works with|Visual Basic|VB6 Standard}} |
|||
<lang vb>Sub Main() |
|||
Const TESTSTRING As String = "alphaBETA" |
|||
Debug.Print "initial = " _ |
|||
& TESTSTRING |
|||
Debug.Print "uppercase = " _ |
|||
& UCase(TESTSTRING) |
|||
Debug.Print "lowercase = " _ |
|||
& LCase(TESTSTRING) |
|||
Debug.Print "first letter capitalized = " _ |
|||
& StrConv(TESTSTRING, vbProperCase) |
|||
Debug.Print "length (in characters) = " _ |
|||
& CStr(Len(TESTSTRING)) |
|||
Debug.Print "length (in bytes) = " _ |
|||
& CStr(LenB(TESTSTRING)) |
|||
Debug.Print "reversed = " _ |
|||
& StrReverse(TESTSTRING) |
|||
Debug.Print "first position of letter A (case-sensitive) = " _ |
|||
& InStr(1, TESTSTRING, "A", vbBinaryCompare) |
|||
Debug.Print "first position of letter A (case-insensitive) = " _ |
|||
& InStr(1, TESTSTRING, "A", vbTextCompare) |
|||
Debug.Print "concatenated with '123' = " _ |
|||
& TESTSTRING & "123" |
|||
End Sub</lang> |
|||
{{out}} |
|||
<pre>initial = alphaBETA |
|||
uppercase = ALPHABETA |
|||
lowercase = alphabeta |
|||
first letter capitalized = Alphabeta |
|||
length (in characters) = 9 |
|||
length (in bytes) = 18 |
|||
reversed = ATEBahpla |
|||
first position of letter A (case-sensitive) = 9 |
|||
first position of letter A (case-insensitive) = 1 |
|||
concatenated with '123' = alphaBETA123</pre> |
|||
=={{header|Vedit macro language}}== |
=={{header|Vedit macro language}}== |