The value you specify in the offset argument is outside the range of positions

The value you specify in the offset argument is

This preview shows page 101 - 103 out of 334 pages.

The value you specify in the offset argument is outside the range of positions in the string. Values you enter for arguments are case-sensitive. Format stringVar .indexOf( substring [, offset ]) Table 43 describes the arguments for the Search String for Substring method. Example 1 The following example returns the position of the first a character that occurs in the string. In this example, the first a character occurs at position 2: var string = "what a string"; var firsta = string.indexOf("a") Table 43. Arguments for the Search String for Substring Method Argument Description substring One or more characters that this method searchs.The substring argument can contain a single character. offset The position in the string at which this method starts searching. This method does the following according to how you set the offset argument: You specify the offset argument. Starts searching at the position that you specify in the offset argument. You do not specify the offset argument. Starts searching at position 0.
Image of page 101
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference String Methods 102 Example 2 The following example returns 3, which is the position of the first a character in the string when starting from the second character of the string: var magicWord = "abracadabra"; var secondA = magicWord.indexOf("a", 1); Related Topics For more information, see the following topics: “Clib Search String for Character Method” on page 261 “Clib Search String for Character Set Method” on page 262 “Search String for Last Substring Method” on page 102 Search String for Last Substring Method The Search String for Last Substring method searches the stringVar variable for the string that you specify in the substring argument. It returns the position of the last occurrence of this string in a string. If any of the following situations is true, then it returns a value of negative 1: It does not find the value that you specify in the substring argument. The value you specify in the offset argument is outside the range of positions in the string. Note the following: To limit the search to a string of leftmost characters of the string, you can use the offset argument. The first character of the substring must occur at a position that is no greater than the offset. If the value you specify in the substring argument does not occur entirely before or at the offset, then the Search String for Last Substring method still returns the position of the substring that it finds. This method uses the same arguments as the Search String for Substring method. For more information, see Table 43 on page 101 . Format stringVar .lastIndexOf( substring [, offset ]) This method does the following according to how you specify the offset argument: You do specify the offset argument. It searches the string up to the position that you specify in the offset argument, and then returns the rightmost position at which the substring begins. It does not consider any substring that occurs after the position that you specify in the offset argument.
Image of page 102
Image of page 103

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors