Skip to content

Instantly share code, notes, and snippets.

@vbcupu
Created October 27, 2017 15:44
Show Gist options
  • Save vbcupu/8c503650f861c4f43353b2e7a145f5b1 to your computer and use it in GitHub Desktop.
Save vbcupu/8c503650f861c4f43353b2e7a145f5b1 to your computer and use it in GitHub Desktop.
Operasi String vb6
Private Sub cmdCoba_Click()
Dim strTest As String
strTest = InputBox("Please enter a string:")
Print "Contoh Len:"; Tab(25); Len(strTest)
Print "Contoh Mid$:"; Tab(25); Mid$(strTest, 3, 4)
Print "Contoh Left$:"; Tab(25); Left$(strTest, 3)
Print "Contoh Right$:"; Tab(25); Right$(strTest, 2)
Print "Contoh UCase$:"; Tab(25); UCase$(strTest)
Print "Contoh LCase$:"; Tab(25); LCase$(strTest)
Print "Contoh Instr:"; Tab(25); InStr(strTest, "a")
Print "Contoh InstrRev:"; Tab(25); InStrRev(strTest, "a")
Print "Contoh LTrim$:"; Tab(25); LTrim$(strTest)
Print "Contoh RTrim$:"; Tab(25); RTrim$(strTest)
Print "Contoh Trim$:"; Tab(25); Trim$(strTest)
Print "Contoh String$ & Space$:"; Tab(25); String$(3, "*") _
& Space$(2) _
& Trim$(strTest) _
& Space$(2) _
& String$(3, 42)
Print "Contoh Replace$:"; Tab(25); Replace$(strTest, "a", "*")
Print "Contoh StrReverse$:"; Tab(25); StrReverse$(strTest)
Print "Contoh Asc:"; Tab(25); Asc(strTest)
Print "Contoh Len:"; Tab(25); Len(strTest)
Print "Contoh Mid$:"; Tab(25); Mid$(strTest, 3, 4)
Print "Contoh Left$:"; Tab(25); Left$(strTest, 3)
Print "Contoh Right$:"; Tab(25); Right$(strTest, 2)
Print "Contoh UCase$:"; Tab(25); UCase$(strTest)
Print "Contoh LCase$:"; Tab(25); LCase$(strTest)
Print "Contoh Instr:"; Tab(25); InStr(strTest, "a")
Print "Contoh InstrRev:"; Tab(25); InStrRev(strTest, "a")
Print "Contoh LTrim$:"; Tab(25); LTrim$(strTest)
Print "Contoh RTrim$:"; Tab(25); RTrim$(strTest)
Print "Contoh Trim$:"; Tab(25); Trim$(strTest)
Print "Contoh String$ & Space$:"; Tab(25); String$(3, "*") _
& Space$(2) _
& Trim$(strTest) _
& Space$(2) _
& String$(3, 42)
Print "Contoh Replace$:"; Tab(25); Replace$(strTest, "a", "*")
Print "Contoh StrReverse$:"; Tab(25); StrReverse$(strTest)
Print "Contoh Asc:"; Tab(25); Asc(strTest)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment