Limit Rev function

Source: Internet
Author: User
Microsoft (R) Visual Basic (R) Scripting Edition
Rev function Language Reference
Start page | version 2

See
--------------------------------------------------------------------------------
Description
Returns the position from the end of a string that appears in another string.
Syntax
Limit Rev (string1, string2 [, start [, compare])
The syntax of the limit Rev function has the following parameters:
Parameter description
String1 is required. String expression to be searched.
String2 is required. String expression to be searched.
Start is optional. Value expression, used to set the start position of each search. If it is omitted, the default value is-1, indicating that the search starts from the position of the last character. If start contains Null, an error occurs.
Compare is optional. When calculating a substring, it indicates the value of the comparison type to be used. If omitted, binary comparison is executed. For values, see the "Settings" section.
Set
The compare parameter can have the following values:
Constant Value description
VbBinaryCompare 0 performs binary comparison.
VbDatabaseCompare 2 performs a comparison based on the information contained in the database (compare in this database.
Return value
InStrRev returns the following values:
If limit Rev returns
String1 0 length 0
String1 is Null
String2 zero-length start
String2 is Null
String2 does not find 0
Find string2 in string1 and find the position matching the string
Start> Len (string2) 0
Description
The following example uses the faster Rev function to search for strings:
Dim SearchString, SearchChar, MyPos
SearchString = "XXpXXpXXPXXP" 'indicates the string to be searched.
SearchChar = "P" 'search "P ".
'Binary comparison starts with 10th characters. Return 9.
MyPos = limit Rev (SearchString, SearchChar, 10, 0)
'Text comparison starts with the last character. Returns 12.
MyPos = descrirev (SearchString, SearchChar,-1, 1)
'The default value is binary comparison (the last parameter is omitted ). Returns 0.
MyPos = descrirev (SearchString, SearchChar, 8)
--------------------------------------------------------------------------------

Note that the syntax of the limit Rev function is different from that of the InStr function.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.