0% found this document useful (0 votes)
40 views

Exercise 4

This Visual Basic code defines a class with a button click event handler that takes user input from a text box, splits it on spaces into an array, capitalizes the first letters of the first and last names, and displays the initials in a label. It extracts the initials from the input string, capitalizes them, and displays the concatenated initials on the label.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Exercise 4

This Visual Basic code defines a class with a button click event handler that takes user input from a text box, splits it on spaces into an array, capitalizes the first letters of the first and last names, and displays the initials in a label. It extracts the initials from the input string, capitalizes them, and displays the concatenated initials on the label.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim array As String() = TextBox1.Text.Split(" ")
Dim name As String = array(0).Substring(0, 1).ToUpper
Dim last As String = array(1).Substring(0, 1).ToUpper

Label2.Text = name + last


End Sub
End Class

You might also like