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)

    There’s a basic rule which runs through all kinds of music, kind of an unwritten rule. I don’t know what it is. But I’ve got it.
    Ron Wood (b. 1947)