Berikut ini listing Penggunaan Fungsi String:
Public Class Penggunaan_Fungsi_String
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
Dim x As String
tahun.Text = "20" & Microsoft.VisualBasic.Left(npm.Text, 2)
x = Microsoft.VisualBasic.Mid(npm.Text, 3, 1)
If x = "1" Then
jenjang.Text = "Starata I"
ElseIf x = "3" Then
jenjang.Text = "Deploma III"
ElseIf x = "4" Then
jenjang.Text = "Deploma I"
End If
x = Microsoft.VisualBasic.Mid(npm.Text, 4, 2)
If x = "01" Then
jurusan.Text = "Manajemen Informatika"
ElseIf x = "02" Then
jurusan.Text = "Sisitem Informatika"
ElseIf x = "03" Then
jurusan.Text = "Teknik Informatika"
ElseIf x = "04" Then
jurusan.Text = "Akutansi"
End If
no.Text = Microsoft.VisualBasic.Right(npm.Text, 3)
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
npm.Text = ""
jurusan.Text = ""
jenjang.Text = ""
tahun.Text = ""
no.Text = ""
End Sub
End Class
Semoga Penggunaan Fungsi Sting diatas dapat bermanfaat bagi para Programer Pemula.
0 komentar:
Speak up your mind
Tell us what you're thinking... !