Right: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Right(''string'', ''length'') | |||
== Description == | |||
Right returns a string containing a number of characters from the right end of a string. The required parameter, ''string'', is any valid string expression. The required parameter, ''length'', is any valid numeric expression, if ''length'' is 0, an empty string ("") is returned, if ''length'' is greater than the size of ''string'', the entire string is returned. | |||
== Example == | |||
<pre> | <pre> | ||
Rem Right Example | |||
' | 'Right returns sub string from string right end | ||
Dim Wendy, Eric | |||
Wendy = "Testaburger" | Wendy = "Testaburger" | ||
Eric = "Cartman" | Eric = "Cartman" | ||
Print "The Right 6 of " & Wendy & ":", _ | |||
Right(Wendy, 6) | |||
Print "The Right 4 of " & Eric & ":", _ | |||
Right(Eric, 4) | |||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
The | The Right 6 of Testaburger:burger | ||
The | The Right 4 of Cartman: tman | ||
</pre> | </pre> | ||
== Related Items == | |||
[[left|LEFT]], [[mid|MID]] | [[left|LEFT]], [[mid|MID]] | ||
[[Category:Language Reference]] |
Revision as of 02:57, 17 August 2012
Right(string, length)
Description
Right returns a string containing a number of characters from the right end of a string. The required parameter, string, is any valid string expression. The required parameter, length, is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.
Example
Rem Right Example 'Right returns sub string from string right end Dim Wendy, Eric Wendy = "Testaburger" Eric = "Cartman" Print "The Right 6 of " & Wendy & ":", _ Right(Wendy, 6) Print "The Right 4 of " & Eric & ":", _ Right(Eric, 4)
Output
The Right 6 of Testaburger:burger The Right 4 of Cartman: tman