Crystal Reports for Eclipse Designer Guide

InStr

Description
The InStr function returns the position of the first occurrence of one string within another.
Overloads
  • InStr (str1, str2)
  • InStr (start, str1, str2)
  • InStr (str1, str2, compare)
  • InStr (start, str1, str2, compare)
  • Arguments
  • start is the character in str1 where the search is to begin. This is a 1 based index. (This argument is optional.)
  • str1 is the text string to be searched.
  • str2 is the text string being sought within str1.
  • compare is an optional number value indicating which type of string comparison should be used. 0 indicates case-sensitive comparison, and 1 indicates case-insensitive comparison. If this argument is not used, a case-sensitive comparison is performed.
  • Returns
    Whole Number
    Action
    The InStr function returns the position of the first occurrence of one string within another. This position is a 1 based index of the characters in str1. If str2 is not found in str1, the InStr function returns 0. The start argument sets the starting position for the search. If the compare argument is not used, the string comparison will be case-sensitive.
    Typical uses
    Use this function to determine if one string contains another.
    Examples
    InStr("abcdefg", "bcd")
    Returns 2.
    InStr(3, "abcdefg", "cde")
    Returns 3.
    InStr("KarenJudith","karen",1)
    Returns 1. Note that because the compare argument equals 1, the comparison was case-insensitive.
    Comments
    There are two versions of this function, with regards to the start argument. The first does not use the start argument, the second does. If the start argument is not used, InStr searches all of str1 to try to find str2. If the start argument is used, InStr begins searching at the character in str2 indicated by the start argument.



    SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/