Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.lang
Class StringHelper

java.lang.Object
  extended by oracle.adfnmc.java.lang.StringHelper

public class StringHelper
extends java.lang.Object


Constructor Summary
StringHelper()
           
 
Method Summary
static int compareToIgnoreCase(java.lang.String strA, java.lang.String strB)
           
static boolean contains(java.lang.String s, java.lang.String cs)
           Determines if this String contains the sequence of characters in the CharSequence passed.
static int lastIndexOf(java.lang.String haystack, java.lang.String needle)
          Searches in this String for the last index of the specified string.
static int lastIndexOf(java.lang.String haystack, java.lang.String subString, int start)
          Searches in this String for the index of the specified string.
static java.lang.String replaceAll(java.lang.String s1, java.lang.String expr, java.lang.String substitute)
          Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
static java.lang.String[] split(java.lang.String stringToSplit, java.lang.String expr)
          Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
static java.lang.String[] split(java.lang.String stringToSplit, java.lang.String expr, int max)
          Splits this String using the supplied regular expression expr.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringHelper

public StringHelper()
Method Detail

lastIndexOf

public static int lastIndexOf(java.lang.String haystack,
                              java.lang.String needle)
Searches in this String for the last index of the specified string. The search for the string starts at the end and moves towards the beginning of this String.

Parameters:
string - the string to find
Returns:
the index in this String of the specified string, -1 if the string isn't found
Throws:
java.lang.NullPointerException - when string is null
See Also:
#lastIndexOf(int), #lastIndexOf(int, int), #lastIndexOf(String), #lastIndexOf(String, int)

lastIndexOf

public static int lastIndexOf(java.lang.String haystack,
                              java.lang.String subString,
                              int start)
Searches in this String for the index of the specified string. The search for the string starts at the specified offset and moves towards the beginning of this String.

Parameters:
subString - the string to find
start - the starting offset
Returns:
the index in this String of the specified string, -1 if the string isn't found
Throws:
java.lang.NullPointerException - when string is null
See Also:
#lastIndexOf(int), #lastIndexOf(int, int), #lastIndexOf(String), #lastIndexOf(String, int)

split

public static java.lang.String[] split(java.lang.String stringToSplit,
                                       java.lang.String expr)
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.

Parameters:
expr - the regular expression to match
Returns:
the new string
Throws:
java.lang.NullPointerException - if expr is null
Since:
1.4

split

public static java.lang.String[] split(java.lang.String stringToSplit,
                                       java.lang.String expr,
                                       int max)
Splits this String using the supplied regular expression expr. max controls the number of times that the pattern is applied to the string.

Parameters:
expr - the regular expression used to divide the string
max - the number of times to apply the pattern
Returns:
an array of Strings created by separating the string along matches of the regular expression.
Throws:
java.lang.NullPointerException - if expr is null
Since:
1.4

replaceAll

public static java.lang.String replaceAll(java.lang.String s1,
                                          java.lang.String expr,
                                          java.lang.String substitute)
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.

Parameters:
expr - the regular expression to match
substitute - the string to replace the matching substring with
Returns:
the new string
Throws:
java.lang.NullPointerException - if expr is null
Since:
1.4

contains

public static boolean contains(java.lang.String s,
                               java.lang.String cs)

Determines if this String contains the sequence of characters in the CharSequence passed.

Parameters:
cs - The character sequence to search for.
Returns:
true if the sequence of characters are contained in this object; otherwise false
Since:
1.5

compareToIgnoreCase

public static int compareToIgnoreCase(java.lang.String strA,
                                      java.lang.String strB)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.