<< 向前        下一页 >>

ID : 9153

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 字符串型 data.
Number of characters
Specify the number of characters from the left end by 整数型 data.

Return value

字符串型 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 : 9153

<< 向前        下一页 >>