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:

    “Dialogue should simply be a sound among other sounds, just something that comes out of the mouths of people whose eyes tell the story in visual terms.”
    —Alfred Hitchcock (1899–1980)

    “Of course I lie to people. But I lie altruistically—for our mutual good. The lie is the basic building block of good manners. That may seem mildly shocking to a moralist—but then what isn’t?”
    —Quentin Crisp (b. 1908)