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:

    To write well, to have style ... is to paint. The master faculty of style is therefore the visual memory. If a writer does not see what he describes—countrysides and figures, movements and gestures—how could he have a style, that is originality?
    Rémy De Gourmont (1858–1915)

    When you realize how hard it is to know the truth about yourself, you understand that even the most exhaustive and well-meaning autobiography, determined to tell the truth, represents, at best, a guess. There have been times in my life when I felt incredibly happy. Life was full. I seemed productive. Then I thought,”Am I really happy or am I merely masking a deep depression with frantic activity?” If I don’t know such basic things about myself, who does?
    Phyllis Rose (b. 1942)