Len (programming) - Use in Visual Basic

Use in Visual Basic

In Visual Basic, the prototype of the Len function is this:

Function Len (ByVal Str As String)

An example below shows an example of the use of Len function.

Sub Main Dim Str As String Dim Int As Integer Str = InputBox("Enter a string") Int = Len(Str) MsgBox(CStr(Int)) End Sub

This function reads a string from an input box and outputs its length.

For example, the input "Hello!" will output 6.

Read more about this topic:  Len (programming)

Famous quotes containing the words visual and/or basic:

    The chess pieces are the block alphabet which shapes thoughts; and these thoughts, although making a visual design on the chess-board, express their beauty abstractly, like a poem.... I have come to the personal conclusion that while all artists are not chess players, all chess players are artists.
    Marcel Duchamp (1887–1968)

    The basic difference between classical music and jazz is that in the former the music is always greater than its performance—Beethoven’s Violin Concerto, for instance, is always greater than its performance—whereas the way jazz is performed is always more important than what is being performed.
    André Previn (b. 1929)