<< Prev        Next >>

ID : 280

Left

Function

To return a string of the specified number of characters from the left end.

Syntax

Left(string, number of characters)

Guaranteed entry

String
Designate String Type data.
Number of characters
Specify the number of characters from the left end by Integer Type data.

Return value

String Type data.

Description

A string of the specified number of characters from the left end is returned.

When "0" is specified for number of characters, return value is "".

If a value larger than the number of characters of string is specified for number of characters, all specified strings are returned as return value.

Related Terms

Asc, Chr, SprintF, Len, Mid, Right, Val, InStr, Bin

Attention

-

Example

'!TITLE "Acquiring Designated Number of Characters from Left End of String"
' Acquire 3 characters from the left end of a string "abcdefg"
Sub Sample_Left

  Dim aaa As String

  ' Assign 3 characters from the left end of a string "abcdefg" to aaa
  aaa = Left( "abcdefg", 3 )

  ' Display "abc" on the message output window
  PrintDbg aaa

End Sub

ID : 280

<< Prev        Next >>