java.lang

Class String

Implemented Interfaces:
CharSequence, Comparable<T>, Serializable

public final class String
extends Object
implements Serializable, Comparable<T>, CharSequence

The String class represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class.

Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared. For example:

     String str = "abc";
 

is equivalent to:

     char data[] = {'a', 'b', 'c'};
     String str = new String(data);
 

Here are some more examples of how strings can be used:

     System.out.println("abc");
     String cde = "cde";
     System.out.println("abc" + cde);
     String c = "abc".substring(2,3);
     String d = cde.substring(1, 2);
 

The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class.

The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. String concatenation is implemented through the StringBuilder(or StringBuffer) class and its append method. String conversions are implemented through the method toString, defined by Object and inherited by all classes in Java. For additional information on string concatenation and conversion, see Gosling, Joy, and Steele, The Java Language Specification.

Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown.

A String represents a string in the UTF-16 format in which supplementary characters are represented by surrogate pairs (see the section Unicode Character Representations in the Character class for more information). Index values refer to char code units, so a supplementary character uses two positions in a String.

The String class provides methods for dealing with Unicode code points (i.e., characters), in addition to those for dealing with Unicode code units (i.e., char values).

Since:
JDK1.0
See Also:
Object.toString(), StringBuffer, StringBuilder, Charset, Serialized Form

Field Summary

static Comparator
CASE_INSENSITIVE_ORDER
A Comparator that orders String objects as by compareToIgnoreCase.

Constructor Summary

String()
Initializes a newly created String object so that it represents an empty character sequence.
String(bytes[] )
Constructs a new String by decoding the specified array of bytes using the platform's default charset.
String(bytes[] , int offset, int length)
Constructs a new String by decoding the specified subarray of bytes using the platform's default charset.
String(bytes[] , int offset, int length, String charsetName)
Constructs a new String by decoding the specified subarray of bytes using the specified charset.
String(bytes[] , String charsetName)
Constructs a new String by decoding the specified array of bytes using the specified charset.
String(int[] codePoints, int offset, int count)
Allocates a new String that contains characters from a subarray of the Unicode code point array argument.
String(String original)
Initializes a newly created String object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string.
String(StringBuffer buffer)
Allocates a new string that contains the sequence of characters currently contained in the string buffer argument.
String(StringBuilder builder)
Allocates a new string that contains the sequence of characters currently contained in the string builder argument.
String(value[] )
Allocates a new String so that it represents the sequence of characters currently contained in the character array argument.
String(value[] , int offset, int count)
Allocates a new String that contains characters from a subarray of the character array argument.

Method Summary

char
charAt(int index)
Returns the char value at the specified index.
int
codePointAt(int index)
Returns the character (Unicode code point) at the specified index.
int
codePointBefore(int index)
Returns the character (Unicode code point) before the specified index.
int
codePointCount(int beginIndex, int endIndex)
Returns the number of Unicode code points in the specified text range of this String.
int
compareTo(String anotherString)
Compares two strings lexicographically.
int
compareToIgnoreCase(String str)
Compares two strings lexicographically, ignoring case differences.
String
concat(String str)
Concatenates the specified string to the end of this string.
boolean
contains(CharSequence s)
Returns true if and only if this string contains the specified sequence of char values.
boolean
contentEquals(CharSequence cs)
Returns true if and only if this String represents the same sequence of char values as the specified sequence.
boolean
contentEquals(StringBuffer sb)
Returns true if and only if this String represents the same sequence of characters as the specified StringBuffer.
static String
copyValueOf(data[] )
Returns a String that represents the character sequence in the array specified.
static String
copyValueOf(data[] , int offset, int count)
Returns a String that represents the character sequence in the array specified.
boolean
endsWith(String suffix)
Tests if this string ends with the specified suffix.
boolean
equals(Object anObject)
Compares this string to the specified object.
boolean
equalsIgnoreCase(String anotherString)
Compares this String to another String, ignoring case considerations.
static String
format(String format, ... args)
Returns a formatted string using the specified format string and arguments.
static String
format(Locale l, String format, ... args)
Returns a formatted string using the specified locale, format string, and arguments.
byte[]
getBytes()
Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.
byte[]
getBytes(String charsetName)
Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
void
getChars(int srcBegin, int srcEnd, dst[] , int dstBegin)
Copies characters from this string into the destination character array.
int
hashCode()
Returns a hash code for this string.
int
indexOf(int ch)
Returns the index within this string of the first occurrence of the specified character.
int
indexOf(int ch, int fromIndex)
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
int
indexOf(String str)
Returns the index within this string of the first occurrence of the specified substring.
int
indexOf(String str, int fromIndex)
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
String
intern()
Returns a canonical representation for the string object.
int
lastIndexOf(int ch)
Returns the index within this string of the last occurrence of the specified character.
int
lastIndexOf(int ch, int fromIndex)
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.
int
lastIndexOf(String str)
Returns the index within this string of the rightmost occurrence of the specified substring.
int
lastIndexOf(String str, int fromIndex)
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index.
int
length()
Returns the length of this string.
boolean
matches(String regex)
Tells whether or not this string matches the given regular expression.
int
offsetByCodePoints(int index, int codePointOffset)
Returns the index within this String that is offset from the given index by codePointOffset code points.
boolean
regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len)
Tests if two string regions are equal.
boolean
regionMatches(int toffset, String other, int ooffset, int len)
Tests if two string regions are equal.
String
replace(char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
String
replace(CharSequence target, CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.
String
replaceAll(String regex, String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement.
String
replaceFirst(String regex, String replacement)
Replaces the first substring of this string that matches the given regular expression with the given replacement.
String[]
split(String regex)
Splits this string around matches of the given regular expression.
String[]
split(String regex, int limit)
Splits this string around matches of the given regular expression.
boolean
startsWith(String prefix)
Tests if this string starts with the specified prefix.
boolean
startsWith(String prefix, int toffset)
Tests if this string starts with the specified prefix beginning a specified index.
CharSequence
subSequence(int beginIndex, int endIndex)
Returns a new character sequence that is a subsequence of this sequence.
String
substring(int beginIndex)
Returns a new string that is a substring of this string.
String
substring(int beginIndex, int endIndex)
Returns a new string that is a substring of this string.
char[]
toCharArray()
Converts this string to a new character array.
String
toLowerCase()
Converts all of the characters in this String to lower case using the rules of the default locale.
String
toLowerCase(Locale locale)
Converts all of the characters in this String to lower case using the rules of the given Locale.
String
toString()
This object (which is already a string!) is itself returned.
String
toUpperCase()
Converts all of the characters in this String to upper case using the rules of the default locale.
String
toUpperCase(Locale locale)
Converts all of the characters in this String to upper case using the rules of the given Locale.
String
trim()
Returns a copy of the string, with leading and trailing whitespace omitted.
static String
valueOf(boolean b)
Returns the string representation of the boolean argument.
static String
valueOf(char c)
Returns the string representation of the char argument.
static String
valueOf(data[] )
Returns the string representation of the char array argument.
static String
valueOf(data[] , int offset, int count)
Returns the string representation of a specific subarray of the char array argument.
static String
valueOf(double d)
Returns the string representation of the double argument.
static String
valueOf(float f)
Returns the string representation of the float argument.
static String
valueOf(int i)
Returns the string representation of the int argument.
static String
valueOf(Object obj)
Returns the string representation of the Object argument.
static String
valueOf(long l)
Returns the string representation of the long argument.
@Deprecated
void getBytes(int srcBegin, int srcEnd, dst[] , int dstBegin)
Deprecated. This method does not properly convert characters into bytes.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

CASE_INSENSITIVE_ORDER

public static final Comparator CASE_INSENSITIVE_ORDER
A Comparator that orders String objects as by compareToIgnoreCase. This comparator is serializable.

Note that this Comparator does not take locale into account, and will result in an unsatisfactory ordering for certain locales. The java.text package provides Collators to allow locale-sensitive ordering.

Since:
1.2
Usages and Demos :

View More Examples of CASE_INSENSITIVE_ORDER
   1: public class AlphabeticSearch {
   2:   public static void main(String[] args) {
   3:         ...
   4:     String[] sa = Generated.array(new String[30],
   5:       new RandomGenerator.String(5));
   6:         ...
   7:     Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
   8:     System.out.println(Arrays.toString(sa));
   9:         ...
  10:     int index = Arrays.binarySearch(sa, sa[10],
  11:       String.CASE_INSENSITIVE_ORDER);

View Full Code Here
   1:             public int compare(T o1, T o2) {
   2:                 return String.CASE_INSENSITIVE_ORDER.compare( o1.getMessage(), o2.getMessage() );
   3:             }
   4:         ...
   5:             public int compare(T o1, T o2) {
   6:                 String s1 = (o1.getColumn() == null) ? "" : o1.getColumn().getName();
   7:         ...
   8:                 String s2 = (o2.getColumn() == null) ? "" : o2.getColumn().getName();
   9:         ...
  10:                 return String.CASE_INSENSITIVE_ORDER.compare( s1, s2 );

View Full Code Here
   1: public class ListSortSearch {
   2:   public static void main(String[] args) {
   3:         ...
   4:     List<String> list =
   5:         ...
   6:       new ArrayList<String>(Utilities.list);
   7:     list.addAll(Utilities.list);
   8:         ...
   9:       ", list.get(" + index + ") = " + list.get(index));
  10:     Collections.sort(list, String.CASE_INSENSITIVE_ORDER);

View Full Code Here
   1:     public
   2:     String toString()
   3:     {
   4:         ...
   5:     {
   6:         return String.CASE_INSENSITIVE_ORDER.compare(a, b);
   7:     }
   8: }

View Full Code Here
   1:         public int compare(File o1, File o2) {
   2:             return String.CASE_INSENSITIVE_ORDER.compare( 
   3:                     o1.getAbsolutePath(), o2.getAbsolutePath() );
   4:         }
   5:     };

View Full Code Here

Constructor Details

String

public String()
Initializes a newly created String object so that it represents an empty character sequence. Note that use of this constructor is unnecessary since Strings are immutable.
Usages and Demos :

View More Examples of String()
   1:     private
   2:     String()
   3:     {}
   4: 
   5:     private

View Full Code Here
   1:         assertFalse(this.user.equals(null));
   2:         assertFalse(this.user.equals(new String()));
   3:         assertFalse(new GDataAccount().equals(new GDataAccount()));
   4:     }
   5:     public void testHashCode(){

View Full Code Here
   1:         register(ASN1Type.NULL, (new Object()).getClass());
   2:         register(ASN1Type.OBJECT_ID, (new String()).getClass());
   3:         register(ASN1Type.BIT_STRING, (new Object()).getClass());
   4:         ...
   5:         register(ASN1Type.IA5String, (new String()).getClass());
   6:         ...
   7:         register(ASN1Type.T61String, (new String()).getClass());
   8:         register(ASN1Type.PrintableString, (new String()).getClass());

View Full Code Here
   1:         assertFalse(schema.equals(null));
   2:         assertFalse(schema.equals(new String()));
   3:         assertTrue(schema.equals(schema));
   4:         assertFalse(schema.equals(new IndexSchema()));
   5:         IndexSchema s1 = new IndexSchema();

View Full Code Here
   1:     private Class[] parseHandlerArgType = 
   2:     { (new Object()).getClass(), (new String()).getClass() };
   3: 
   4:     private Class[] checkHandlerArgType = 
   5:     { (new Object()).getClass() };

View Full Code Here

String

public String(bytes[] )
Constructs a new String by decoding the specified array of bytes using the platform's default charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array.

The behavior of this constructor when the given bytes are not valid in the default charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.

Parameters:
Since:
JDK1.1
Usages and Demos :

View More Examples of String(bytes[] )
   1:     l=new LinkedList();
   2:     l.add(new String(""));
   3:         ...
   4:     l.add(new String(""));
   5:     gp2.setList(l);
   6:     l.clear();
   7:     gp2.printListCount();

View Full Code Here
   1:          case RESULTSPAN:
   2:             return new String("RESULTSPAN");
   3:          case RESULTSET:
   4:         ...
   5:             return new String("RESULTSET");
   6:          case ANALYSIS:
   7:         ...
   8:             return new String("ANALYSIS");
   9:          default:

View Full Code Here
   1:     super(1, 1);
   2:     addElement(new String(""));
   3:   }
   4:         ...
   5:       removeElementAt(0);
   6:     addElement(new String(""));
   7:     current = elementCount - 1;
   8:   }
   9:   

View Full Code Here
   1:          case COMMENT:
   2:             return new String("COMMENT");
   3:          case EVIDENCE:
   4:         ...
   5:             return new String("EVIDENCE");
   6:          case EXON:
   7:         ...
   8:             return new String("EXON");
   9:          case TRANSLATION:

View Full Code Here
   1:             RETURNHolder rETURN = new RETURNHolder();
   2:             binding.nestedSvc2(new java.lang.String("0000001000"),
   3:         ...
   4:                                new java.lang.String("01"),
   5:         ...
   6:                                new java.lang.String("00"),
   7:                                new java.lang.String(""),

View Full Code Here

String

public String(bytes[] ,
              int offset,
              int length)
Constructs a new String by decoding the specified subarray of bytes using the platform's default charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the subarray.

The behavior of this constructor when the given bytes are not valid in the default charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.

Parameters:
offset - the index of the first byte to decode
length - the number of bytes to decode
Throws:
IndexOutOfBoundsException - if the offset and the length arguments index characters outside the bounds of the bytes array
Since:
JDK1.1
Usages and Demos :

View More Examples of String(bytes[] ,int offset,int length)
   1:     {    if (N==0) return "";
   2:         return new String(Buf,0,N);
   3:     }
   4: }

View Full Code Here
   1:     public String getState(){
   2:         return new String("????????dep="+dep+",month="+month+",cost="+cost);
   3:     }
   4: }
   5: class MementoReport1{

View Full Code Here
   1:     {
   2:         return new String( "( " + x + ", " + y + ", " + z + ")" );
   3:     }
   4: }

View Full Code Here
   1:         
   2:           assertEquals( "count", new String("COUNT(value1,value2,...)"),
   3:                       new FunctionCount().getUsage() );
   4:         ...
   5:       public void testFgetUsageAVG() {
   6:           assertEquals( "average", new String("AVERAGE(value1,value2,...)"),
   7:                       new FunctionAverage().getUsage() );
   8:         ...
   9:       public void testFgetUsageMIN() {
  10:           assertEquals( "min", new String("MIN(value1,value2,...)"),
  11:                       new FunctionMin().getUsage() );

View Full Code Here
   1:         if (S == null)
   2:             S = new String(C, COffset, CLength);
   3:         
   4:         return S;
   5:     }

View Full Code Here

String

public String(bytes[] ,
              int offset,
              int length,
              String charsetName)
            throws UnsupportedEncodingException
Constructs a new String by decoding the specified subarray of bytes using the specified charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the subarray.

The behavior of this constructor when the given bytes are not valid in the given charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.

Parameters:
offset - the index of the first byte to decode
length - the number of bytes to decode
charsetName - the name of a supported charset
Throws:
UnsupportedEncodingException - if the named charset is not supported
IndexOutOfBoundsException - if the offset and length arguments index characters outside the bounds of the bytes array
Since:
JDK1.1
Usages and Demos :

View More Examples of String(bytes[] ,int offset,int length,String charsetName)
   1:     public static String AsciizToString(byte[] b) { 
   2:     return new String(b, 0, 0, b.length - 1);
   3:     }
   4:     
   5:     public static byte[] StringToAsciiz(String s) { 

View Full Code Here
   1:     public void write(byte[] b, int off, int len) throws IOException {
   2:         _writer.write(new String(b, 0, b.length, _charset));
   3:     }
   4:         ...
   5:                 _bs[_cnt ++] = (byte)b;
   6:                     _writer.write(new String(_bs, 0, _type, _charset));
   7:                 }
   8:                 return;
   9:                 for (int j = 0; j < _cnt; ++j)

View Full Code Here
   1:                 if(_recdata[i] == 0 && _recdata[i + 1] == 0) {
   2:                     name = new String(_recdata, 0, i, "UTF-16LE");
   3:                     break;
   4:                 }
   5:                 i += 2;

View Full Code Here
   1:     try {
   2:       return new String(_buffer, 0, _length, encoding);
   3:     } catch (Exception e) {
   4:       return new String(_buffer, 0, _length);
   5:     }

View Full Code Here
   1:     public LongString(byte ascii[], int hibyte, int offset, int count) {
   2:         inner = new String(ascii, hibyte, offset, count);
   3:     }
   4: 
   5:     public LongString(char value[]) {

View Full Code Here

String

public String(bytes[] ,
              String charsetName)
            throws UnsupportedEncodingException
Constructs a new String by decoding the specified array of bytes using the specified charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array.

The behavior of this constructor when the given bytes are not valid in the given charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.

Parameters:
charsetName - the name of a supported charset
Throws:
UnsupportedEncodingException - If the named charset is not supported
Since:
JDK1.1
Usages and Demos :

View More Examples of String(bytes[] ,String charsetName)
   1:     public String toString() {
   2:     return new String("("+x+", "+y+") w = "+width+" h = "+height);
   3:     }
   4: 
   5: }

View Full Code Here
   1: 
   2:       return new String(""+StringOps.zeroPad(d,3)+","+
   3:                            StringOps.zeroPad(h,2)+":"+
   4:                            StringOps.zeroPad(m,2)+":"+
   5:                            StringOps.zeroPad(s,2));       

View Full Code Here
   1: 
   2:       return new String(""+StringOps.zeroPad(d,3)+","+
   3:                            StringOps.zeroPad(h,2)+":"+
   4:                            StringOps.zeroPad(m,2)+":"+
   5:                            StringOps.zeroPad(s,2));       

View Full Code Here
   1:     public String toString() {
   2:         return new String("Native8Code[k="+k+",n="+n+"]");
   3:     }
   4: }

View Full Code Here
   1:     {
   2:     return new String("("+x+","+y+")");
   3:     }
   4: 
   5:     public int distanceSquared(Point p)

View Full Code Here

String

public String(int[] codePoints,
              int offset,
              int count)
Allocates a new String that contains characters from a subarray of the Unicode code point array argument. The offset argument is the index of the first code point of the subarray and the count argument specifies the length of the subarray. The contents of the subarray are converted to chars; subsequent modification of the int array does not affect the newly created string.
Parameters:
codePoints - array that is the source of Unicode code points.
offset - the initial offset.
count - the length.
Throws:
IllegalArgumentException - if any invalid Unicode code point is found in codePoints
IndexOutOfBoundsException - if the offset and count arguments index characters outside the bounds of the codePoints array.
Since:
1.5
Usages and Demos :

View More Examples of String(int[] codePoints,int offset,int count)
   1:     {    if (N==0) return "";
   2:         return new String(Buf,0,N);
   3:     }
   4: }

View Full Code Here
   1:     public String getState(){
   2:         return new String("????????dep="+dep+",month="+month+",cost="+cost);
   3:     }
   4: }
   5: class MementoReport1{

View Full Code Here
   1:     {
   2:         return new String( "( " + x + ", " + y + ", " + z + ")" );
   3:     }
   4: }

View Full Code Here
   1:         
   2:           assertEquals( "count", new String("COUNT(value1,value2,...)"),
   3:                       new FunctionCount().getUsage() );
   4:         ...
   5:       public void testFgetUsageAVG() {
   6:           assertEquals( "average", new String("AVERAGE(value1,value2,...)"),
   7:                       new FunctionAverage().getUsage() );
   8:         ...
   9:       public void testFgetUsageMIN() {
  10:           assertEquals( "min", new String("MIN(value1,value2,...)"),
  11:                       new FunctionMin().getUsage() );

View Full Code Here
   1:         if (S == null)
   2:             S = new String(C, COffset, CLength);
   3:         
   4:         return S;
   5:     }

View Full Code Here

String

public String(String original)
Initializes a newly created String object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string. Unless an explicit copy of original is needed, use of this constructor is unnecessary since Strings are immutable.
Parameters:
original - a String.
Usages and Demos :

View More Examples of String(String original)
   1:     l=new LinkedList();
   2:     l.add(new String(""));
   3:         ...
   4:     l.add(new String(""));
   5:     gp2.setList(l);
   6:     l.clear();
   7:     gp2.printListCount();

View Full Code Here
   1:          case RESULTSPAN:
   2:             return new String("RESULTSPAN");
   3:          case RESULTSET:
   4:         ...
   5:             return new String("RESULTSET");
   6:          case ANALYSIS:
   7:         ...
   8:             return new String("ANALYSIS");
   9:          default:

View Full Code Here
   1:     super(1, 1);
   2:     addElement(new String(""));
   3:   }
   4:         ...
   5:       removeElementAt(0);
   6:     addElement(new String(""));
   7:     current = elementCount - 1;
   8:   }
   9:   

View Full Code Here
   1:          case COMMENT:
   2:             return new String("COMMENT");
   3:          case EVIDENCE:
   4:         ...
   5:             return new String("EVIDENCE");
   6:          case EXON:
   7:         ...
   8:             return new String("EXON");
   9:          case TRANSLATION:

View Full Code Here
   1:             RETURNHolder rETURN = new RETURNHolder();
   2:             binding.nestedSvc2(new java.lang.String("0000001000"),
   3:         ...
   4:                                new java.lang.String("01"),
   5:         ...
   6:                                new java.lang.String("00"),
   7:                                new java.lang.String(""),

View Full Code Here

String

public String(StringBuffer buffer)
Allocates a new string that contains the sequence of characters currently contained in the string buffer argument. The contents of the string buffer are copied; subsequent modification of the string buffer does not affect the newly created string.
Parameters:
buffer - a StringBuffer.
Usages and Demos :

View More Examples of String(StringBuffer buffer)
   1:     l=new LinkedList();
   2:     l.add(new String(""));
   3:         ...
   4:     l.add(new String(""));
   5:     gp2.setList(l);
   6:     l.clear();
   7:     gp2.printListCount();

View Full Code Here
   1:          case RESULTSPAN:
   2:             return new String("RESULTSPAN");
   3:          case RESULTSET:
   4:         ...
   5:             return new String("RESULTSET");
   6:          case ANALYSIS:
   7:         ...
   8:             return new String("ANALYSIS");
   9:          default:

View Full Code Here
   1:     super(1, 1);
   2:     addElement(new String(""));
   3:   }
   4:         ...
   5:       removeElementAt(0);
   6:     addElement(new String(""));
   7:     current = elementCount - 1;
   8:   }
   9:   

View Full Code Here
   1:          case COMMENT:
   2:             return new String("COMMENT");
   3:          case EVIDENCE:
   4:         ...
   5:             return new String("EVIDENCE");
   6:          case EXON:
   7:         ...
   8:             return new String("EXON");
   9:          case TRANSLATION:

View Full Code Here
   1:             RETURNHolder rETURN = new RETURNHolder();
   2:             binding.nestedSvc2(new java.lang.String("0000001000"),
   3:         ...
   4:                                new java.lang.String("01"),
   5:         ...
   6:                                new java.lang.String("00"),
   7:                                new java.lang.String(""),

View Full Code Here

String

public String(StringBuilder builder)
Allocates a new string that contains the sequence of characters currently contained in the string builder argument. The contents of the string builder are copied; subsequent modification of the string builder does not affect the newly created string.

This constructor is provided to ease migration to StringBuilder. Obtaining a string from a string builder via the toString method is likely to run faster and is generally preferred.

Parameters:
builder - a StringBuilder
Since:
1.5
Usages and Demos :

View More Examples of String(StringBuilder builder)
   1:     l=new LinkedList();
   2:     l.add(new String(""));
   3:         ...
   4:     l.add(new String(""));
   5:     gp2.setList(l);
   6:     l.clear();
   7:     gp2.printListCount();

View Full Code Here
   1:          case RESULTSPAN:
   2:             return new String("RESULTSPAN");
   3:          case RESULTSET:
   4:         ...
   5:             return new String("RESULTSET");
   6:          case ANALYSIS:
   7:         ...
   8:             return new String("ANALYSIS");
   9:          default:

View Full Code Here
   1:     super(1, 1);
   2:     addElement(new String(""));
   3:   }
   4:         ...
   5:       removeElementAt(0);
   6:     addElement(new String(""));
   7:     current = elementCount - 1;
   8:   }
   9:   

View Full Code Here
   1:          case COMMENT:
   2:             return new String("COMMENT");
   3:          case EVIDENCE:
   4:         ...
   5:             return new String("EVIDENCE");
   6:          case EXON:
   7:         ...
   8:             return new String("EXON");
   9:          case TRANSLATION:

View Full Code Here
   1:             RETURNHolder rETURN = new RETURNHolder();
   2:             binding.nestedSvc2(new java.lang.String("0000001000"),
   3:         ...
   4:                                new java.lang.String("01"),
   5:         ...
   6:                                new java.lang.String("00"),
   7:                                new java.lang.String(""),

View Full Code Here

String

public String(value[] )
Allocates a new String so that it represents the sequence of characters currently contained in the character array argument. The contents of the character array are copied; subsequent modification of the character array does not affect the newly created string.
Parameters:
Usages and Demos :

View More Examples of String(value[] )
   1:     l=new LinkedList();
   2:     l.add(new String(""));
   3:         ...
   4:     l.add(new String(""));
   5:     gp2.setList(l);
   6:     l.clear();
   7:     gp2.printListCount();

View Full Code Here
   1:          case RESULTSPAN:
   2:             return new String("RESULTSPAN");
   3:          case RESULTSET:
   4:         ...
   5:             return new String("RESULTSET");
   6:          case ANALYSIS:
   7:         ...
   8:             return new String("ANALYSIS");
   9:          default:

View Full Code Here
   1:     super(1, 1);
   2:     addElement(new String(""));
   3:   }
   4:         ...
   5:       removeElementAt(0);
   6:     addElement(new String(""));
   7:     current = elementCount - 1;
   8:   }
   9:   

View Full Code Here
   1:          case COMMENT:
   2:             return new String("COMMENT");
   3:          case EVIDENCE:
   4:         ...
   5:             return new String("EVIDENCE");
   6:          case EXON:
   7:         ...
   8:             return new String("EXON");
   9:          case TRANSLATION:

View Full Code Here
   1:             RETURNHolder rETURN = new RETURNHolder();
   2:             binding.nestedSvc2(new java.lang.String("0000001000"),
   3:         ...
   4:                                new java.lang.String("01"),
   5:         ...
   6:                                new java.lang.String("00"),
   7:                                new java.lang.String(""),

View Full Code Here

String

public String(value[] ,
              int offset,
              int count)
Allocates a new String that contains characters from a subarray of the character array argument. The offset argument is the index of the first character of the subarray and the count argument specifies the length of the subarray. The contents of the subarray are copied; subsequent modification of the character array does not affect the newly created string.
Parameters:
offset - the initial offset.
count - the length.
Throws:
IndexOutOfBoundsException - if the offset and count arguments index characters outside the bounds of the value array.
Usages and Demos :

View More Examples of String(value[] ,int offset,int count)
   1:     {    if (N==0) return "";
   2:         return new String(Buf,0,N);
   3:     }
   4: }

View Full Code Here
   1:     public String getState(){
   2:         return new String("????????dep="+dep+",month="+month+",cost="+cost);
   3:     }
   4: }
   5: class MementoReport1{

View Full Code Here
   1:     {
   2:         return new String( "( " + x + ", " + y + ", " + z + ")" );
   3:     }
   4: }

View Full Code Here
   1:         
   2:           assertEquals( "count", new String("COUNT(value1,value2,...)"),
   3:                       new FunctionCount().getUsage() );
   4:         ...
   5:       public void testFgetUsageAVG() {
   6:           assertEquals( "average", new String("AVERAGE(value1,value2,...)"),
   7:                       new FunctionAverage().getUsage() );
   8:         ...
   9:       public void testFgetUsageMIN() {
  10:           assertEquals( "min", new String("MIN(value1,value2,...)"),
  11:                       new FunctionMin().getUsage() );

View Full Code Here
   1:         if (S == null)
   2:             S = new String(C, COffset, CLength);
   3:         
   4:         return S;
   5:     }

View Full Code Here

Method Details

charAt

public char charAt(int index)
Returns the char value at the specified index. An index ranges from 0 to length() - 1. The first char value of the sequence is at index 0, the next at index 1, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Specified by:
charAt in interface CharSequence
Parameters:
index - the index of the char value.
Returns:
the char value at the specified index of this string. The first char value is at index 0.
Throws:
IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string.
Usages and Demos :

View More Examples of charAt(int index)
   1:   SCOUT, CARGO, TRANSPORT, CRUISER, BATTLESHIP, MOTHERSHIP;
   2:   public String toString() {
   3:         ...
   4:     String id = name();
   5:         ...
   6:     String lower = id.substring(1).toLowerCase();
   7:         ...
   8:     return id.charAt(0) + lower;

View Full Code Here
   1: 
   2:     protected Object getReferenceKey(String reference) {
   3:         final Path path = new Path(reference);
   4:         ...
   5:         return reference.charAt(0) != '/' ? pathTracker.getPath().apply(path) : path;
   6:     }
   7: 
   8:     protected Object getCurrentReferenceKey() {

View Full Code Here
   1: public class CharConverter {
   2:     public static String convert(char c) {
   3:         return Character.toString(c);
   4:         ...
   5: 
   6:     public static char convert(String value) throws FieldConvertError {
   7:         if (value.length() != 1) {
   8:         ...
   9:         }
  10:         return value.charAt(0);
  11:     }

View Full Code Here
   1: public class CharacterNode extends ConstantNode {
   2:    String val;
   3:    
   4:         ...
   5:    public CharacterNode(String id,boolean filter,boolean isErr,Token tok,int iL) {
   6:       super(CHARTYPE,isErr,tok,iL);
   7:         ...
   8:       temp[0]=v;
   9:       val=new String(temp);
  10:       beNode=IdlParser.beFactory.createBENode(this);
  11:         ...
  12: 
  13:    public char getValue() { return val.charAt(0); }

View Full Code Here
   1: 
   2:   public String getResidues() {
   3:     return getResidues(0,getLength() - 1);
   4:         ...
   5: 
   6:   public String getResidues(int start, int end) {
   7:     StringBuffer seq = new StringBuffer();
   8:         ...
   9: 
  10:   public String    getDisplayId  () {
  11:     return seq.getDisplayId();
  12:         ...
  13:     String transCodon = ResidueProperties.codonTranslate(codon.toString());
  14:     return transCodon.charAt(0);

View Full Code Here

codePointAt

public int codePointAt(int index)
Returns the character (Unicode code point) at the specified index. The index refers to char values (Unicode code units) and ranges from 0 to length() - 1.

If the char value specified at the given index is in the high-surrogate range, the following index is less than the length of this String, and the char value at the following index is in the low-surrogate range, then the supplementary code point corresponding to this surrogate pair is returned. Otherwise, the char value at the given index is returned.

Parameters:
index - the index to the char values
Returns:
the code point value of the character at the index
Throws:
IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string.
Since:
1.5

codePointBefore

public int codePointBefore(int index)
Returns the character (Unicode code point) before the specified index. The index refers to char values (Unicode code units) and ranges from 1 to length.

If the char value at (index - 1) is in the low-surrogate range, (index - 2) is not negative, and the char value at (index - 2) is in the high-surrogate range, then the supplementary code point value of the surrogate pair is returned. If the char value at index - 1 is an unpaired low-surrogate or a high-surrogate, the surrogate value is returned.

Parameters:
index - the index following the code point that should be returned
Returns:
the Unicode code point value before the given index.
Throws:
IndexOutOfBoundsException - if the index argument is less than 1 or greater than the length of this string.
Since:
1.5

codePointCount

public int codePointCount(int beginIndex,
                          int endIndex)
Returns the number of Unicode code points in the specified text range of this String. The text range begins at the specified beginIndex and extends to the char at index endIndex - 1. Thus the length (in chars) of the text range is endIndex-beginIndex. Unpaired surrogates within the text range count as one code point each.
Parameters:
beginIndex - the index to the first char of the text range.
endIndex - the index after the last char of the text range.
Returns:
the number of Unicode code points in the specified text range
Throws:
IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this String, or beginIndex is larger than endIndex.
Since:
1.5
Usages and Demos :

View More Examples of codePointCount(int beginIndex,int endIndex)
   1: 
   2:   public String toString()
   3:   {
   4:         ...
   5:     return String.valueOf(Character.toChars(codePoint_));
   6:   }
   7:         ...
   8: 
   9:   public static ZChar[] toZChars(String string)
  10:   {
  11:         ...
  12:     final int numZChars = string.codePointCount(0, string.length());

View Full Code Here
   1:   private float[] glyphPositions;
   2:   private String s;
   3: 
   4:         ...
   5: 
   6:   public FreetypeGlyphVector(Font f, String s, FontRenderContext frc)
   7:   {
   8:         ...
   9:   {
  10:     this.s = new String(chars, start, len);
  11: 
  12:         ...
  13:   {
  14:     nGlyphs = s.codePointCount( 0, s.length() );

View Full Code Here

compareTo

public int compareTo(String anotherString)
Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string. The result is a negative integer if this String object lexicographically precedes the argument string. The result is a positive integer if this String object lexicographically follows the argument string. The result is zero if the strings are equal; compareTo returns 0 exactly when the equals(Object) method would return true.

This is the definition of lexicographic ordering. If two strings are different, then either they have different characters at some index that is a valid index for both strings, or their lengths are different, or both. If they have different characters at one or more index positions, let k be the smallest such index; then the string whose character at position k has the smaller value, as determined by using the < operator, lexicographically precedes the other string. In this case, compareTo returns the difference of the two character values at position k in the two string -- that is, the value:

 this.charAt(k)-anotherString.charAt(k)
 
If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case, compareTo returns the difference of the lengths of the strings -- that is, the value:
 this.length()-anotherString.length()
 
Parameters:
anotherString - the String to be compared.
Returns:
the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.
Usages and Demos :

View More Examples of compareTo(String anotherString)
   1: 
   2:   private String d_key;
   3: 
   4:         ...
   5:   private String d_value;
   6: 
   7:         ...
   8: 
   9:   public Attribute(String key, String value) {
  10:     d_key = key;
  11:         ...
  12:   public int compareTo(Object o) {
  13:     return d_key.compareTo(((Attribute) o).d_key);

View Full Code Here
   1:   implements AttributeDefinition, Comparable {
   2:   private String attrName;
   3:         ...
   4:   private String attrType;
   5:         ...
   6:   private String[] enumeration;
   7:   private String attrDefaultType;
   8:         ...
   9:       throw new IllegalArgumentException();
  10:     return attrName.compareTo(((AttributeDefinitionImpl)object).attrName);

View Full Code Here
   1: 
   2:    public static void main(String[] argv) throws Exception
   3:    {
   4:         ...
   5: 
   6:    private final boolean endPunc(String s)
   7:    {
   8:         ...
   9:       return (s.compareTo("?") == 0 || s.compareTo("!") == 0 ||
  10:         ...
  11:       s.compareTo(".") == 0);

View Full Code Here
   1:             Component comp = (Component) candIt.next();
   2:             String status = comp.getStringProperty("cpu.status");
   3:         ...
   4:             if (status.compareTo("off-line") != 0 &&
   5:         ...
   6:                 status.compareTo("powered-off") != 0)
   7:                 compList.add(comp);
   8:         ...
   9: 
  10:     public String getName() throws PoolsException

View Full Code Here
   1:   core = cc;
   2:   String dummy[] =null;
   3: 
   4:         ...
   5:     pcpp.setUpdater(this);
   6:     String pc;
   7:     pc = pcname.value;
   8:         ...
   9:     pcpp.setBatchTitle(pcname.value);
  10:     if ( pc.compareTo("identity") == 0 || 
  11:         ...
  12:          pc.compareTo("diagonal") == 0 ) {

View Full Code Here

compareToIgnoreCase

public int compareToIgnoreCase(String str)
Compares two strings lexicographically, ignoring case differences. This method returns an integer whose sign is that of calling compareTo with normalized versions of the strings where case differences have been eliminated by calling Character.toLowerCase(Character.toUpperCase(character)) on each character.

Note that this method does not take locale into account, and will result in an unsatisfactory ordering for certain locales. The java.text package provides collators to allow locale-sensitive ordering.

Parameters:
str - the String to be compared.
Returns:
a negative integer, zero, or a positive integer as the specified String is greater than, equal to, or less than this String, ignoring case considerations.
Since:
1.2
Usages and Demos :

View More Examples of compareToIgnoreCase(String str)
   1: import java.lang.System;
   2:     public void setValue(String val) throws Exception {
   3:         ...
   4:         if (val.compareToIgnoreCase("n")==0 ||
   5:         ...
   6:             val.compareToIgnoreCase("no")==0 ||
   7:         ...
   8:             val.compareToIgnoreCase("nyet")==0 ||

View Full Code Here
   1: 
   2:     public static void main(String[] args) throws Exception {
   3:     MBeanServer mbs = MBeanServerFactory.createMBeanServer();
   4:         ...
   5:     String mbtype = getMBeanType();
   6:     ObjectName cmbname = createMBeanForType(mbs, mbtype);
   7:         ...
   8:     private static ObjectName createMBeanForType(MBeanServer mbs,
   9:                          String mbtype)
  10:     throws Exception {
  11:         ...
  12:     ObjectName oname = new ObjectName("catalog:type=" + mbtype);
  13:     if (mbtype.compareToIgnoreCase("standard") == 0 ||

View Full Code Here

concat

public String concat(String str)
Concatenates the specified string to the end of this string.

If the length of the argument string is 0, then this String object is returned. Otherwise, a new String object is created, representing a character sequence that is the concatenation of the character sequence represented by this String object and the character sequence represented by the argument string.

Examples:

 "cares".concat("s") returns "caress"
 "to".concat("get").concat("her") returns "together"
 
Parameters:
str - the String that is concatenated to the end of this String.
Returns:
a string that represents the concatenation of this object's characters followed by the string argument's characters.
Usages and Demos :

View More Examples of concat(String str)
   1: public class ConcatTest{
   2:     public static void main(String args[]){
   3:         ...
   4:         String str1=new String("???");
   5:         String str2="Java";
   6:         ...
   7:         String str3=new String(str1.concat(str2));
   8:         System.out.println(str3);

View Full Code Here
   1: public class ClassLoaderResourceHandler extends URLStreamHandler {
   2:     public static final String PROTOCOL = "classpath";
   3:     
   4:         ...
   5:     
   6:     protected String toExternalForm (final URL url) {
   7:         ...
   8:         return PROTOCOL.concat(":").concat(url.getFile());
   9:     }
  10:         ...
  11:         public InputStream getInputStream () throws IOException {
  12:             String resourceName = url.getFile ();

View Full Code Here
   1: 
   2: public String getNames(HttpServletRequest request, HttpServletResponse response) throws IOException {
   3:     response.setContentType("text/html");
   4:         ...
   5:     String s = new String();
   6:     s = "<H1>A list of names from a <br>MySQL table</H1>";
   7:         ...
   8:         while (resultSet.next()) {
   9:             s.concat("<tr><td>" + resultSet.getString("FirstName") + "</td><td>" + resultSet.getString("LastName") + "</td></tr>");
  10:         }

View Full Code Here
   1:     
   2:     private String value;
   3:     private boolean defined = false;
   4:         ...
   5:     }
   6:     public String getValue()
   7:     {
   8:         ...
   9:             {
  10:     public void setValue(String value)
  11:     {
  12:         ...
  13:             for(int i = 1; i <= size; i++)
  14:                 value.concat("0");

View Full Code Here
   1: 
   2:   TagParser(String location) throws IOException
   3:   {
   4:         ...
   5:           DomHTMLParamElement curr = (DomHTMLParamElement) c;
   6:           String key = curr.getName();
   7:         ...
   8:           String val = curr.getValue();
   9:           
  10:         ...
  11:           {
  12:             unescVal = unescVal.concat(value.substring(i));

View Full Code Here

contains

public boolean contains(CharSequence s)
Returns true if and only if this string contains the specified sequence of char values.
Parameters:
s - the sequence to search for
Returns:
true if this string contains s, false otherwise
Throws:
NullPointerException - if s is null
Since:
1.5
Usages and Demos :

View More Examples of contains(CharSequence s)
   1: 
   2:     public static void assertContains(String xml, String text) {
   3:         ...
   4:         Assert.assertTrue(xml.contains(text));
   5:     }
   6:         ...
   7: 
   8:     public static void assertMatches(String xml, Pattern pattern) {
   9:         Matcher matcher = pattern.matcher(xml);
  10:         ...
  11:     public static void assertNoElement(String xml, String element, String value) {
  12:         Assert.assertFalse(xml.contains("<" + element + ">" + value + "</" + element + ">"));

View Full Code Here
   1: 
   2:     private String vocab;
   3:         ...
   4:     private String hint;
   5: 
   6:         ...
   7:     public Vocab(String vocab, String hint) {
   8:         assert(vocab != null);
   9:         ...
  10: 
  11:         return (vocab.contains(character.toString())) ? true : false;

View Full Code Here
   1:     
   2:     private static final String RESERVED = ";/?:@&=+$,";
   3: 
   4:         ...
   5: 
   6:     public static URI toURI(final String uriString) throws URISyntaxException {
   7:         URI uri;
   8:         ...
   9:         } catch (URISyntaxException e) {
  10:             String encodedURIString = encodeURI(uriString);
  11:             try {
  12:         ...
  13:     private static boolean isDelimiter(String s) {
  14:         return RESERVED.contains(s);

View Full Code Here
   1: 
   2:     private boolean isVarName(String line) {
   3:         ...
   4:         return line.contains("...");
   5:     }
   6:         ...
   7: 
   8:     private String getVarName(String line) {
   9:         int x = line.indexOf("...");
  10:         ...
  11:     private boolean isEndOfTable(String line) {
  12:         return line.contains("MAX")

View Full Code Here
   1: 
   2:     public static void main(String[] args) {
   3:         int numItr = Integer.parseInt(args[1]);
   4:         ...
   5:                 Object o = e.next();
   6:                 if (!union.contains(o))
   7:                     fail("Set doesn't contain one of its elements.");
   8:         ...
   9:                 e.remove();
  10:                 if (union.contains(o))
  11:                     fail("Set contains element after deletion.");
  12:         ...
  13:             int preSize = s.size();
  14:             boolean prePresent = s.contains(e);

View Full Code Here

contentEquals

public boolean contentEquals(CharSequence cs)
Returns true if and only if this String represents the same sequence of char values as the specified sequence.
Parameters:
cs - the sequence to compare to.
Returns:
true if and only if this String represents the same sequence of char values as the specified sequence, otherwise false.
Throws:
NullPointerException - if cs is null
Since:
1.5

contentEquals

public boolean contentEquals(StringBuffer sb)
Returns true if and only if this String represents the same sequence of characters as the specified StringBuffer.
Parameters:
sb - the StringBuffer to compare to.
Returns:
true if and only if this String represents the same sequence of characters as the specified StringBuffer, otherwise false.
Throws:
NullPointerException - if sb is null
Since:
1.4

copyValueOf

public static String copyValueOf(data[] )
Returns a String that represents the character sequence in the array specified.
Parameters:
Returns:
a String that contains the characters of the character array.
Usages and Demos :

View More Examples of copyValueOf(data[] )
   1:     }
   2:     public void addString(String s)
   3:     {
   4:         ...
   5:             {
   6:                 System.out.println(String.copyValueOf((char[]) o));
   7:             }
   8:         ...
   9:     }
  10:     public static void main(String args[])
  11:     {
  12:         ...
  13:         char letters[]={'a','b','c','d'};
  14:         String s=new String ("hi there@!");

View Full Code Here
   1: public final class InputSourceOps {
   2:     private static String XML_DOCUMENT_HEADER_PREFIX = "<?xml";
   3: 
   4:         ...
   5: 
   6:     private static boolean hasScheme(String systemId) {
   7:         int colonIdx = systemId.indexOf(':');
   8:         ...
   9: 
  10:    public static InputStream openSystemId(String systemId) throws IOException {
  11:         if (systemId == null) {
  12:         ...
  13:         }
  14:         return String.copyValueOf(buf).equals(XML_DOCUMENT_HEADER_PREFIX);

View Full Code Here
   1: public final class InputSourceOps {
   2:     private static String XML_DOCUMENT_HEADER_PREFIX = "<?xml";
   3: 
   4:         ...
   5: 
   6:     private static boolean hasScheme(String systemId) {
   7:         int colonIdx = systemId.indexOf(':');
   8:         ...
   9: 
  10:    public static InputStream openSystemId(String systemId) throws IOException {
  11:         if (systemId == null) {
  12:         ...
  13:         }
  14:         return String.copyValueOf(buf).equals(XML_DOCUMENT_HEADER_PREFIX);

View Full Code Here
   1: 
   2:     public static UInt16Array unicodeString(String string) {
   3:         ...
   4:         return make(string.toCharArray());
   5:     }
   6:         ...
   7:         
   8:         return String.copyValueOf(storage);
   9:     }

View Full Code Here
   1: 
   2:     public static void main(String[] args)
   3:     {
   4:         ...
   5:         System.out.println("aaa" == "aaa");
   6:         System.out.println("aaa" == new String("aaa"));
   7:         ...
   8:         System.out.println("aaa" == new String(ca));
   9:         System.out.println("aaa" == new String(ca).intern());
  10:         ...
  11:         System.out.println("aaa" == String.valueOf(ca));
  12:         System.out.println("aaa" == String.copyValueOf(ca));

View Full Code Here

copyValueOf

public static String copyValueOf(data[] ,
                                 int offset,
                                 int count)
Returns a String that represents the character sequence in the array specified.
Parameters:
offset - initial offset of the subarray.
count - length of the subarray.
Returns:
a String that contains the characters of the specified subarray of the character array.
Usages and Demos :

View More Examples of copyValueOf(data[] ,int offset,int count)
   1:          {
   2:             logger.info(String.copyValueOf(cbuf, off, len));
   3:          }
   4:       }

View Full Code Here
   1:          if ( len > 0 ) {
   2:             logger.log( level, String.copyValueOf( cbuf, off, len ) );
   3:          }
   4:       }

View Full Code Here
   1:          if ( len > 0 ) {
   2:             category.log( priority, String.copyValueOf( cbuf, off, len ) );
   3:          }
   4:       }

View Full Code Here
   1: 
   2:     public String readLine() throws IOException {
   3:     InputStream in = this.in;
   4:         ...
   5:     
   6:     return String.copyValueOf(buf, 0, offset);
   7:     }
   8: }

View Full Code Here
   1: 
   2:   public static String getAsString(InputStream is)
   3:   {
   4:         ...
   5:       }
   6:       return String.copyValueOf(buf, 0, offset);
   7:   }
   8: 
   9: }

View Full Code Here

endsWith

public boolean endsWith(String suffix)
Tests if this string ends with the specified suffix.
Parameters:
suffix - the suffix.
Returns:
true if the character sequence represented by the argument is a suffix of the character sequence represented by this object; false otherwise. Note that the result will be true if the argument is the empty string or is equal to this String object as determined by the equals(Object) method.
Usages and Demos :

View More Examples of endsWith(String suffix)
   1: public class Import {
   2:     private String _name;
   3: 
   4:         ...
   5: 
   6:     public Import(String name) {
   7:         _name = name;
   8:         ...
   9: 
  10:     public void setName(String name) {
  11:         _name = name;
  12:         ...
  13:     public boolean isWildcard() {
  14:         return _name.endsWith("*");

View Full Code Here
   1: public class Token {
   2:     String m_str;
   3:     int m_start_pos, m_end_pos;
   4:         ...
   5:     Token(String str, int start_pos, int end_pos){
   6:         m_str=str;
   7:         ...
   8:         
   9:     static List<Token> parseExpressionToken(String text){
  10:         StringTokenizer tk=new StringTokenizer(text,sTerminators,true),tk1=null;
  11:         ...
  12:     public boolean isTag(){
  13:         return m_str!=null&&m_str.startsWith("<")&&m_str.endsWith(">");

View Full Code Here
   1: {
   2:     public final static String foo()
   3:     {
   4:         ...
   5:     
   6:     public final static String capitalize(String s)
   7:     {
   8:         ...
   9:     {
  10:         return s!=null && s.endsWith("[]");
  11:     }

View Full Code Here
   1: {
   2:     private final String namespace;
   3:         ...
   4:     private final String name;
   5:     
   6:         ...
   7:     
   8:     public Resource(String name)
   9:     {
  10:         ...
  11:         assert namespace == null || 
  12:             namespace.endsWith("#") || 

View Full Code Here
   1:     
   2:     protected boolean isKeyword(String token) {
   3:         return keywords.contains(token);
   4:         ...
   5:     
   6:     protected boolean isNumber(String token) {
   7:         StringCharacterIterator iterator = 
   8:         ...
   9:         
  10:     protected boolean isString(String token) {
  11:         return (token.length() > 1) 
  12:         ...
  13:             & token.startsWith("\"") 
  14:             & token.endsWith("\"");

View Full Code Here

equals

public boolean equals(Object anObject)
Compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.
Overrides:
equals in interface Object
Parameters:
anObject - the object to compare this String against.
Returns:
true if the String are equal; false otherwise.
Usages and Demos :

View More Examples of equals(Object anObject)
   1: {
   2:    private String value;
   3: 
   4:         ...
   5: 
   6:    public RefType(String value)
   7:    {
   8:         ...
   9: 
  10:    public String getValue()
  11:    {
  12:         ...
  13:       RefType other = (RefType)obj;
  14:       return value != null && value.equals(other.value) || value == null && other.value == null;

View Full Code Here
   1:     public static final ElementHandlerAdapter NOP = new ElementHandlerAdapter() {
   2:         public IElementHandler startChildElement(String tagName,
   3:                 Attributes attributes) {
   4:         ...
   5: 
   6:     public void endElement(String tagName) {
   7:     }
   8:         ...
   9: 
  10:     public void endChildElement(String tagName) {
  11:     }
  12:         ...
  13:     protected boolean matches(String tagName, String option) {
  14:         return tagName != null && tagName.equals(option);

View Full Code Here
   1: public class ContainsFilter implements VLJTableFilter  {
   2:   String filter;
   3:         ...
   4:   String lowerCaseFilter;
   5:   
   6:         ...
   7: 
   8:   public ContainsFilter(boolean ignoreCase, String filter) {
   9:     this.ignoreCase = ignoreCase;
  10:         ...
  11:   public boolean isFiltering() {
  12:     return filter != null && !filter.equals("");

View Full Code Here
   1: public class StartsWithFilter implements VLJTableFilter {
   2:   protected String filter = null;
   3:   protected boolean ignoreCase = false;
   4:         ...
   5:   protected String lowerCaseFilter;
   6:   
   7:         ...
   8: 
   9:   public StartsWithFilter(String filter) {
  10:     this.filter = filter;
  11:         ...
  12:   public boolean isFiltering() {
  13:     return filter != null && !filter.equals("");

View Full Code Here
   1: {
   2:     private String value;
   3:     
   4:         ...
   5:     private String checked;
   6:     
   7:         ...
   8:     {
   9:         return value != null && checked != null && value.equals(checked);
  10:     }
  11:         ...
  12:     
  13:     public void setName(final String name) 

View Full Code Here

equalsIgnoreCase

public boolean equalsIgnoreCase(String anotherString)
Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length, and corresponding characters in the two strings are equal ignoring case.

Two characters c1 and c2 are considered the same, ignoring case if at least one of the following is true:

Parameters:
anotherString - the String to compare this String against.
Returns:
true if the argument is not null and the Strings are equal, ignoring case; false otherwise.
Usages and Demos :

View More Examples of equalsIgnoreCase(String anotherString)
   1: {
   2:     public java.lang.String name;
   3: public Operator() {
   4:         ...
   5: }
   6: public Operator(String oper)
   7: {
   8:         ...
   9: }
  10: public java.lang.String getName() {
  11:     return name;
  12:         ...
  13: public boolean isAND() {
  14:     return name.equalsIgnoreCase("and");

View Full Code Here
   1:         try {
   2:             String stringValue = value.toString();
   3:         ...
   4:             if (stringValue.equalsIgnoreCase("yes") ||
   5:         ...
   6:                 stringValue.equalsIgnoreCase("y") ||
   7:         ...
   8:                 stringValue.equalsIgnoreCase("true") ||

View Full Code Here
   1: 
   2:    public String getName() {
   3:       return name;
   4:         ...
   5: 
   6:    public void setName(String name) {
   7:       this.name = name.toUpperCase();
   8:         ...
   9: 
  10:    public String getType() {
  11:       return type;
  12:         ...
  13:    static public String getSQLName(String name) {
  14:       if (name.equalsIgnoreCase("PERSON_ID") ||

View Full Code Here
   1:                 IInputValidator validator = new IInputValidator() {
   2:                     public String isValid(String newText) {
   3:         ...
   4:                         if(newText.equalsIgnoreCase("SWT/JFace") ||
   5:         ...
   6:                                 newText.equalsIgnoreCase("AWT") ||
   7:         ...
   8:                                 newText.equalsIgnoreCase("Swing"))

View Full Code Here
   1:     }
   2:     public boolean hasFeature(String feature, String version) {
   3:         
   4:         ...
   5:         
   6:         if ((feature.equalsIgnoreCase("+XPath"))       
   7:             && (anyVersion || version.equals("3.0"))) {
   8:         ...
   9:         return (
  10:             feature.equalsIgnoreCase("Core")
  11:                 && (anyVersion
  12:         ...
  13:                     || version.equals("3.0")))
  14:                     || (feature.equalsIgnoreCase("XML")

View Full Code Here

format

public static String format(String format,
                            ... args)
Returns a formatted string using the specified format string and arguments.

The locale always used is the one returned by Locale.getDefault().

Parameters:
format - A format string
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
A formatted string
Throws:
NullPointerException - If the format is null
Since:
1.5
See Also:
Formatter
Usages and Demos :

View More Examples of format(String format,... args)
   1: {  
   2:    public static void main(String[] args)
   3:    {  
   4:         ...
   5:       double futureBalance = INITIAL_BALANCE * Math.pow(1 + rate, nperiods);
   6:       return String.format("%.2f", futureBalance);
   7:    }
   8:         ...
   9: 
  10:    public String getColumnName(int c) { return (c + minRate) + "%"; }

View Full Code Here
   1:         
   2:             if(v instanceof String)
   3:             {
   4:         ...
   5:                 String str = (String) v;
   6:                 str = str.replace(',', '.');
   7:                 
   8:                 try

View Full Code Here
   1:     public static class MemStorage extends AbstractGripStorage {
   2:         public TreeSet<String> nurseNames = new TreeSet<String>();
   3: 
   4:         ...
   5:         @Override
   6:         public String[] getNurseNames() {
   7:             return nurseNames.toArray(new String[0]);
   8:         ...
   9:                                     .format(
  10:                                             "String.format(\"%.3f\", 4.512) = \"%s\" instead of \"4.512\". Check internationalization settings.",
  11:         ...
  12:                                             String.format("%.3f", 4.512)));

View Full Code Here
   1:     @Override
   2:     public String toString() {
   3:         return display();
   4:         ...
   5: 
   6:     public String display() {
   7:         ...
   8:         String ret = "<";
   9:         boolean first = true;
  10:         ...
  11:             double d = queue.getPriority(n);
  12:             ret += "(" + n.component + "/" + String.format("%.4f", d) + "/"

View Full Code Here
   1: 
   2:     public static void main(String[] args) throws Exception {
   3:         Random r = new Random();
   4:         ...
   5:         String uniqString = "";
   6:         for (int i = 0; i < 4; i++) {
   7:         ...
   8:         }
   9:         final String uString = uniqString;
  10:         int b;
  11:         ...
  12:     public void checkConfiguration() {
  13:         if (!String.format("%.3f", 4.512).equals("4.512")) {

View Full Code Here

format

public static String format(Locale l,
                            String format,
                            ... args)
Returns a formatted string using the specified locale, format string, and arguments.
Parameters:
l - The locale to apply during formatting. If l is null then no localization is applied.
format - A format string
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
A formatted string
Throws:
NullPointerException - If the format is null
Since:
1.5
See Also:
Formatter
Usages and Demos :

View More Examples of format(Locale l,String format,... args)
   1: 
   2:   public String toString()
   3:   {
   4:         ...
   5:     return String.format("%s - %s", requestId, response);
   6:   }
   7: }

View Full Code Here
   1:     @Override
   2:     public void parse(final String value) throws ParseException {
   3:         if (TK.isEmpty(value)) {
   4:         ...
   5:         try {
   6:             String[] tokens = value.split("\\.");
   7:             set(
   8:         ...
   9:     @Override
  10:     public String toString() {
  11:         int major = getMajor();
  12:         ...
  13:         if (bugfix == 0)
  14:             return String.format("%d.%d", major, minor);

View Full Code Here
   1:   @Override
   2:   public String toString()
   3:   {
   4:         ...
   5:     return String.format("%s - %s", objectInstanceHandle, attributeHandles);
   6:   }
   7: }

View Full Code Here
   1: 
   2: import static java.lang.String.format;
   3: import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
   4:         ...
   5: 
   6:     public static void main(String[] args) throws Exception
   7:     {
   8:         ...
   9:         {
  10:             Map<String, Attributes> entries = mf.getEntries();
  11:             List<String> keys = newList(entries.keySet());

View Full Code Here
   1: 
   2:   public String toString()
   3:   {
   4:         ...
   5:     return String.format("%s - %s", objectInstanceHandle, attributeValues);
   6:   }
   7: }

View Full Code Here

getBytes

public byte[] getBytes()
Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.

The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.

Returns:
The resultant byte array
Since:
JDK1.1
Usages and Demos :

View More Examples of getBytes()
   1: 
   2:     public String host;
   3: 
   4:         ...
   5:     public GetHostRunnable(String host) {
   6:         this.host = host;
   7:         ...
   8:         try {
   9:             inetaddr = InetAddress.getByName(new String(host.getBytes()));
  10:             inetaddr.getHostAddress();

View Full Code Here
   1: public class TestCharacterEncoding extends BaseTest{
   2:   public TestCharacterEncoding(String s) {
   3:     super(s);
   4:         ...
   5:   public void testSetCharacterEncoding() throws UnsupportedEncodingException {
   6:     String s  = "\u00e1zov portletu";
   7:         ...
   8:     System.out.println("STRING "+s);
   9: 
  10:         ...
  11:     s = "\u8D1F\u8F7D\u6D4B\u8BD5";
  12:     System.out.println(new String(s.getBytes(), "UTF-8"));

View Full Code Here
   1: 
   2: public static String encode (String s) {
   3:         ...
   4:    return new String(encode(s.getBytes())); }
   5: 
   6:         ...
   7: 
   8: public static String decode (String s) {
   9:    return new String(decode(s.toCharArray())); }

View Full Code Here
   1:     public void testSplit3to4() {
   2:         int[] expected = createArray(new String[] { "00111001", "00111111", "00111111", "00110111" });
   3:         ...
   4:         int[] in = createArray(new String[] { "11100111", "11111111", "11110111" });
   5:         int[] out = new int[4];
   6:         ...
   7:     public void testJoin4to3() {
   8:         int[] expected = createArray(new String[] { "11100111", "11111111", "11110111" });
   9:         int[] in = createArray(new String[] { "00111001", "00111111", "00111111", "00110111" });
  10:         ...
  11:         BASE64Encoder encoder = new BASE64Encoder();
  12:         assertEquals(input, new String(codec.decode(encoder.encode(input.getBytes()))));

View Full Code Here
   1: 
   2:     public static String encode(String s)
   3:     {
   4:         ...
   5:         return new String(encode(s.getBytes()));
   6:     }
   7:         ...
   8: 
   9:     public static String decode(String s)
  10:     {

View Full Code Here

getBytes

public byte[] getBytes(String charsetName)
            throws UnsupportedEncodingException
Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.

The behavior of this method when this string cannot be encoded in the given charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.

Parameters:
charsetName - the name of a supported charset
Returns:
The resultant byte array
Throws:
UnsupportedEncodingException - If the named charset is not supported
Since:
JDK1.1
Usages and Demos :

View More Examples of getBytes(String charsetName)
   1: public class URLEncodeIdMapper implements ResourceIdToPathMapper {
   2:     public String getPathForId(Object resourceId) {
   3:         ...
   4:         String path = resourceId.toString();
   5:         try {
   6:         ...
   7:             path = new String(Base64.encodeBase64(path.getBytes("UTF-8")), "ASCII");
   8:             path = URLEncoder.encode(path);

View Full Code Here
   1: 
   2:     public String getHref()
   3:     {
   4:         ...
   5:  
   6:     public String getContentType()
   7:     {
   8:         ...
   9: 
  10:         String text = engine.getHTML( context, m_page );
  11:         
  12:         ...
  13:         {
  14:             return text.getBytes("UTF-8");

View Full Code Here
   1:         FileData file = new FileManager(con).getFile(form.getFileId());
   2:         String fileName = file.getName();
   3:         ...
   4:         fileName = new String(fileName.getBytes(request.getCharacterEncoding()), "ISO8859_1");
   5:         ...
   6:         String contentDisposition = "attachment; filename=\"" + fileName + "\"";
   7:         response.setHeader("Content-Disposition", contentDisposition);

View Full Code Here
   1:         
   2:         String output = writer.toString();
   3: 
   4:         ...
   5:         return output.getBytes( "UTF-8" );
   6:     }
   7: }

View Full Code Here
   1: 
   2:   public static byte[] stringToBytes(String val, int width)
   3:   {
   4:         ...
   5:       if (val.length() == width)
   6:         return val.getBytes("US-ASCII");
   7:       else if (val.length() > width)
   8:         ...
   9:         return val.substring(0, width).getBytes("US-ASCII");
  10:       else
  11:         ...
  12:         }
  13:         return sb.toString().getBytes("US-ASCII");

View Full Code Here

getChars

public void getChars(int srcBegin,
                     int srcEnd,
                     dst[] ,
                     int dstBegin)
Copies characters from this string into the destination character array.

The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1 (thus the total number of characters to be copied is srcEnd-srcBegin). The characters are copied into the subarray of dst starting at index dstBegin and ending at index:

     dstbegin + (srcEnd-srcBegin) - 1
 
Parameters:
srcBegin - index of the first character in the string to copy.
srcEnd - index after the last character in the string to copy.
dstBegin - the start offset in the destination array.
Throws:
IndexOutOfBoundsException - If any of the following is true:
  • srcBegin is negative.
  • srcBegin is greater than srcEnd
  • srcEnd is greater than the length of this string
  • dstBegin is negative
  • dstBegin+(srcEnd-srcBegin) is larger than dst.length
Usages and Demos :

View More Examples of getChars(int srcBegin,int srcEnd,dst[] ,int dstBegin)
   1: public class StringMiscellaneous {
   2:    public static void main( String args[] ){
   3:         ...
   4:       String s1 = "hello there";
   5:       char charArray[] = new char[ 5 ];
   6:         ...
   7:       String output = "s1: " + s1;
   8:       output += "\nThe string reversed is: ";

View Full Code Here
   1: 
   2: public static void main (String [] args) {
   3:     Display display = new Display ();
   4:         ...
   5:         public void handleEvent (Event e) {
   6:             String string = e.text;
   7:             char [] chars = new char [string.length ()];
   8:         ...
   9:             string.getChars(0, chars.length, chars, 0);
  10:             for (int i=0; i<chars.length; i++) {

View Full Code Here
   1: 
   2: public static void main (String [] args) {
   3:     Display display = new Display ();
   4:         ...
   5:         public void handleEvent (Event e) {
   6:             String string = e.text;
   7:             char [] chars = new char [string.length ()];
   8:         ...
   9:             string.getChars(0, chars.length, chars, 0);
  10:             for (int i=0; i<chars.length; i++) {

View Full Code Here
   1: 
   2: public static void main(String[] args) {
   3:     Display display = new Display();
   4:         ...
   5:         public void handleEvent(Event e) {
   6:             String text = e.text;
   7:             char[] chars = new char[text.length()];
   8:         ...
   9:             text.getChars(0, chars.length, chars, 0);
  10:             for (int i = 0; i < chars.length; i++) {

View Full Code Here
   1: package tuning.string;
   2: 
   3:         ...
   4:   {
   5:     String NewLineStr = System.getProperty("line.separator");
   6:     NewLine = new char[NewLineStr.length()];
   7:         ...
   8:     NewLineStr.getChars(0, NewLine.length, NewLine, 0);
   9:   }
  10:         ...
  11:   public static void main(String[] args)

View Full Code Here

hashCode

public int hashCode()
Returns a hash code for this string. The hash code for a String object is computed as
 s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
 
using int arithmetic, where s[i] is the ith character of the string, n is the length of the string, and ^ indicates exponentiation. (The hash value of the empty string is zero.)
Overrides:
hashCode in interface Object
Returns:
a hash code value for this object.
Usages and Demos :

View More Examples of hashCode()
   1:     
   2:     public String message;
   3:     
   4:         ...
   5:     
   6:     public Message( String message ) {
   7:         this.message = message;
   8:         ...
   9:     
  10:     public void setMessage(String message) {
  11:         this.message = message;
  12:         ...
  13:     public int hashCode() {
  14:         return message != null ? message.hashCode() : 0;

View Full Code Here
   1: public class XmlMarkup {
   2:     private String markup;
   3: 
   4:         ...
   5:     public XmlMarkup(String markup) {
   6:         this.markup = markup;
   7:         ...
   8: 
   9:     public String getMarkup() {
  10:         return markup;
  11:         ...
  12:     public int hashCode() {
  13:         return markup != null ? markup.hashCode() : 0;

View Full Code Here
   1: {
   2:     private String id;
   3:         ...
   4:     private List<String> names;
   5:         ...
   6:     private Set<String> parents;
   7:     
   8:         ...
   9:     {
  10:         return id != null ? id.hashCode() : super.hashCode();

View Full Code Here
   1: public class FontFamily implements FontProvider {
   2:     private String name;
   3: 
   4:         ...
   5:     public FontFamily(String name) {
   6:         this.name = name;
   7:         ...
   8: 
   9:     public String getName() {
  10:         return name;
  11:         ...
  12:     public int hashCode() {
  13:         return name != null ? name.hashCode() : 0;

View Full Code Here
   1: 
   2:     public Key(String data) {
   3:         super(data);
   4:     }

View Full Code Here

indexOf

public int indexOf(int ch)
Returns the index within this string of the first occurrence of the specified character. If a character with value ch occurs in the character sequence represented by this String object, then the index (in Unicode code units) of the first such occurrence is returned. For values of ch in the range from 0 to 0xFFFF (inclusive), this is the smallest value k such that:
 this.charAt(k) == ch
 
is true. For other values of ch, it is the smallest value k such that:
 this.codePointAt(k) == ch
 
is true. In either case, if no such character occurs in this string, then -1 is returned.
Parameters:
ch - a character (Unicode code point).
Returns:
the index of the first occurrence of the character in the character sequence represented by this object, or -1 if the character does not occur.
Usages and Demos :

View More Examples of indexOf(int ch)
   1: {
   2:     private String id;
   3:         ...
   4:     private String sequenceId;
   5:         ...
   6:     private String mnemonic;
   7:     private boolean reviewed;
   8:         ...
   9:     {
  10:         return id != null && id.indexOf('-') != -1;

View Full Code Here
   1:    private boolean acceptsGzip(HttpServletRequest request) {
   2:       String acceptEncoding = request.getHeader("Accept-Encoding");
   3:         ...
   4:       return acceptEncoding != null && acceptEncoding.indexOf("gzip") != -1;
   5:    }
   6: 
   7:    public abstract void writeToStream(HttpServletRequest request, HttpServletResponse response, OutputStream out) throws IOException, ServletException;

View Full Code Here
   1:   
   2:     public String toString() {
   3:         return getBattLevel() + "% " + getThreshold() + "%";
   4:         ...
   5:         if (Debug.DEBUG_Misc == true) {
   6:             System.out.print("The battery string is: " + battery_str); 
   7:         }
   8:         ...
   9:         while (st.hasMoreTokens()) {
  10:             String test = st.nextToken();
  11: 
  12:         ...
  13:             if (test.indexOf("%") > -1) {

View Full Code Here
   1:    private boolean acceptsGzip(HttpServletRequest request) {
   2:       String acceptEncoding = request.getHeader("Accept-Encoding");
   3:         ...
   4:       return acceptEncoding != null && acceptEncoding.indexOf("gzip") != -1;
   5:    }
   6: 
   7:    public void init(FilterConfig config) throws ServletException {

View Full Code Here
   1: 
   2:     String auth = request.getHeader("Authorization");
   3:         ...
   4:     String login = "", password = "";
   5: 
   6:         ...
   7:     if (auth != null) {
   8:       auth = new String(Base64.decode(auth.substring(auth.indexOf(' ') + 1)));
   9:         ...
  10:       login = auth.substring(0, auth.indexOf(':'));

View Full Code Here

indexOf

public int indexOf(int ch,
                   int fromIndex)
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.

If a character with value ch occurs in the character sequence represented by this String object at an index no smaller than fromIndex, then the index of the first such occurrence is returned. For values of ch in the range from 0 to 0xFFFF (inclusive), this is the smallest value k such that:

 (this.charAt(k) == ch) && (k >= fromIndex)
 
is true. For other values of ch, it is the smallest value k such that:
 (this.codePointAt(k) == ch) && (k >= fromIndex)
 
is true. In either case, if no such character occurs in this string at or after position fromIndex, then -1 is returned.

There is no restriction on the value of fromIndex. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: -1 is returned.

All indices are specified in char values (Unicode code units).

Parameters:
ch - a character (Unicode code point).
fromIndex - the index to start the search from.
Returns:
the index of the first occurrence of the character in the character sequence represented by this object that is greater than or equal to fromIndex, or -1 if the character does not occur.
Usages and Demos :

View More Examples of indexOf(int ch,int fromIndex)
   1:         ReqHandler rh = null;
   2:         String pathInfo = request.getPathInfo();
   3:         if (pathInfo != null) {
   4:         ...
   5:             int secondSlashPos = (firstSlashPos > -1) ?
   6:                     pathInfo.indexOf('/', firstSlashPos+1) : -1;
   7: 
   8:         ...
   9: 
  10:             String key = null;
  11:             if (firstSlashPos > -1) {

View Full Code Here
   1: public class StringIndexMethods {
   2:    public static void main( String args[] ){
   3:         ...
   4:       String letters = "abcdefghabcdefgh";
   5:         ...
   6:       String output = "'c' is located at index " + letters.indexOf( 'c' );
   7:         ...
   8:       output += "\n'a' is located at index " + letters.indexOf( 'a', 1 );

View Full Code Here
   1:         List<IInterval> ranges = new ArrayList<IInterval>();
   2:         String text = getText();
   3:         int from = 0;
   4:         ...
   5:     
   6:     private IInterval getNextRangeToHighlight(String text, int from) {
   7:         int start = findBeginTrans(text, from);
   8:         ...
   9:     
  10:     private int findBeginTrans(String text, int from) {
  11:         ...
  12:         return text.indexOf(FormulaBuilderConstants.BEGIN_TRANS, from);

View Full Code Here
   1: 
   2:     private final String originalMessage;
   3: 
   4:         ...
   5: 
   6:     public HtmlCharacterEntityDecoder(HtmlCharacterEntityReferences characterEntityReferences, String original) {
   7:         this.characterEntityReferences = characterEntityReferences;
   8:         ...
   9: 
  10:     public String decode() {
  11:         while (currentPosition < originalMessage.length()) {
  12:         ...
  13:             nextPotentialReferencePosition =
  14:                     originalMessage.indexOf('&', nextPotentialReferencePosition);

View Full Code Here
   1: 
   2:         String curLine = null;
   3:         while ((curLine = br.readLine()) != null) {
   4:         ...
   5: 
   6:     private void parseLine(String curLine, ContentHandler ch)
   7:         throws IOException, SAXException {
   8:         ...
   9: 
  10:         String firstToken = null;
  11:         String remainderOfLine = null;
  12:         ...
  13:         } else {
  14:             return curLine.indexOf(',');

View Full Code Here

indexOf

public int indexOf(String str)
Returns the index within this string of the first occurrence of the specified substring. The integer returned is the smallest value k such that:
 this.startsWith(str, k)
 
is true.
Parameters:
str - any string.
Returns:
if the string argument occurs as a substring within this object, then the index of the first character of the first such substring is returned; if it does not occur as a substring, -1 is returned.
Usages and Demos :

View More Examples of indexOf(String str)
   1: {
   2:     private String id;
   3:         ...
   4:     private String sequenceId;
   5:         ...
   6:     private String mnemonic;
   7:     private boolean reviewed;
   8:         ...
   9:     {
  10:         return id != null && id.indexOf('-') != -1;

View Full Code Here
   1:    private boolean acceptsGzip(HttpServletRequest request) {
   2:       String acceptEncoding = request.getHeader("Accept-Encoding");
   3:         ...
   4:       return acceptEncoding != null && acceptEncoding.indexOf("gzip") != -1;
   5:    }
   6: 
   7:    public abstract void writeToStream(HttpServletRequest request, HttpServletResponse response, OutputStream out) throws IOException, ServletException;

View Full Code Here
   1:   
   2:     public String toString() {
   3:         return getBattLevel() + "% " + getThreshold() + "%";
   4:         ...
   5:         if (Debug.DEBUG_Misc == true) {
   6:             System.out.print("The battery string is: " + battery_str); 
   7:         }
   8:         ...
   9:         while (st.hasMoreTokens()) {
  10:             String test = st.nextToken();
  11: 
  12:         ...
  13:             if (test.indexOf("%") > -1) {

View Full Code Here
   1:    private boolean acceptsGzip(HttpServletRequest request) {
   2:       String acceptEncoding = request.getHeader("Accept-Encoding");
   3:         ...
   4:       return acceptEncoding != null && acceptEncoding.indexOf("gzip") != -1;
   5:    }
   6: 
   7:    public void init(FilterConfig config) throws ServletException {

View Full Code Here
   1: 
   2:     String auth = request.getHeader("Authorization");
   3:         ...
   4:     String login = "", password = "";
   5: 
   6:         ...
   7:     if (auth != null) {
   8:       auth = new String(Base64.decode(auth.substring(auth.indexOf(' ') + 1)));
   9:         ...
  10:       login = auth.substring(0, auth.indexOf(':'));

View Full Code Here

indexOf

public int indexOf(String str,
                   int fromIndex)
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. The integer returned is the smallest value k for which:
     k >= Math.min(fromIndex, str.length()) && this.startsWith(str, k)
 
If no such value of k exists, then -1 is returned.
Parameters:
str - the substring for which to search.
fromIndex - the index from which to start the search.
Returns:
the index within this string of the first occurrence of the specified substring, starting at the specified index.
Usages and Demos :

View More Examples of indexOf(String str,int fromIndex)
   1:         ReqHandler rh = null;
   2:         String pathInfo = request.getPathInfo();
   3:         if (pathInfo != null) {
   4:         ...
   5:             int secondSlashPos = (firstSlashPos > -1) ?
   6:                     pathInfo.indexOf('/', firstSlashPos+1) : -1;
   7: 
   8:         ...
   9: 
  10:             String key = null;
  11:             if (firstSlashPos > -1) {

View Full Code Here
   1: public class StringIndexMethods {
   2:    public static void main( String args[] ){
   3:         ...
   4:       String letters = "abcdefghabcdefgh";
   5:         ...
   6:       String output = "'c' is located at index " + letters.indexOf( 'c' );
   7:         ...
   8:       output += "\n'a' is located at index " + letters.indexOf( 'a', 1 );

View Full Code Here
   1:         List<IInterval> ranges = new ArrayList<IInterval>();
   2:         String text = getText();
   3:         int from = 0;
   4:         ...
   5:     
   6:     private IInterval getNextRangeToHighlight(String text, int from) {
   7:         int start = findBeginTrans(text, from);
   8:         ...
   9:     
  10:     private int findBeginTrans(String text, int from) {
  11:         ...
  12:         return text.indexOf(FormulaBuilderConstants.BEGIN_TRANS, from);

View Full Code Here
   1: 
   2:     private final String originalMessage;
   3: 
   4:         ...
   5: 
   6:     public HtmlCharacterEntityDecoder(HtmlCharacterEntityReferences characterEntityReferences, String original) {
   7:         this.characterEntityReferences = characterEntityReferences;
   8:         ...
   9: 
  10:     public String decode() {
  11:         while (currentPosition < originalMessage.length()) {
  12:         ...
  13:             nextPotentialReferencePosition =
  14:                     originalMessage.indexOf('&', nextPotentialReferencePosition);

View Full Code Here
   1: 
   2:         String curLine = null;
   3:         while ((curLine = br.readLine()) != null) {
   4:         ...
   5: 
   6:     private void parseLine(String curLine, ContentHandler ch)
   7:         throws IOException, SAXException {
   8:         ...
   9: 
  10:         String firstToken = null;
  11:         String remainderOfLine = null;
  12:         ...
  13:         } else {
  14:             return curLine.indexOf(',');

View Full Code Here

intern

public String intern()
Returns a canonical representation for the string object.

A pool of strings, initially empty, is maintained privately by the class String.

When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.

It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.

All literal strings and string-valued constant expressions are interned. String literals are defined in §3.10.5 of the Java Language Specification

Returns:
a string that has the same contents as this string, but is guaranteed to be from a pool of unique strings.
Usages and Demos :

View More Examples of intern()
   1:     public boolean canConvert(Class type) {
   2:         return type.equals(String.class);
   3:     }
   4:         ...
   5: 
   6:     public Object fromString(String str) {
   7:         ...
   8:         return str.intern();
   9:     }

View Full Code Here
   1: public final class Strings {
   2:   public static String intern(String s) {
   3:     if (s == null) return null;
   4:         ...
   5:     if (s.length()<56) {
   6:       return s.intern();
   7:     } else {
   8:       return s;
   9:     }

View Full Code Here
   1: public final class NameBuilder {
   2:     private Map<String,Integer> uriIndexMap = new HashMap<String, Integer>();
   3:         ...
   4:     private Set<String> nonDefaultableNsUris = new HashSet<String>();
   5:     private Map<String,Integer> localNameIndexMap = new HashMap<String, Integer>();
   6:         ...
   7:     public Name createAttributeName(String nsUri, String localName) {
   8:         assert nsUri.intern()==nsUri;
   9:         ...
  10:         assert localName.intern()==localName;

View Full Code Here
   1:                     Name clsName = ElementUtils.getQualifiedClassName(method);
   2:                     if (clsName != null && clsName.contentEquals("java.lang.String"))
   3:                         t.getReturnType().addAnnotation(INTERNED);
   4:                 }
   5:             }

View Full Code Here

lastIndexOf

public int lastIndexOf(int ch)
Returns the index within this string of the last occurrence of the specified character. For values of ch in the range from 0 to 0xFFFF (inclusive), the index (in Unicode code units) returned is the largest value k such that:
 this.charAt(k) == ch
 
is true. For other values of ch, it is the largest value k such that:
 this.codePointAt(k) == ch
 
is true. In either case, if no such character occurs in this string, then -1 is returned. The String is searched backwards starting at the last character.
Parameters:
ch - a character (Unicode code point).
Returns:
the index of the last occurrence of the character in the character sequence represented by this object, or -1 if the character does not occur.
Usages and Demos :

View More Examples of lastIndexOf(int ch)
   1:     public boolean accept(File f) {
   2:         String filename = f.getName();
   3:         int filenamelength = filename.length();
   4:         ...
   5:         return filename.lastIndexOf(".txt")==filenamelength-4;
   6:     }
   7:         ...
   8:     public String getDescription() {
   9:         return ".txt";

View Full Code Here
   1: 
   2:         String nombre_del_archivo = f.getName();
   3: 
   4:         ...
   5: 
   6:         return nombre_del_archivo.lastIndexOf(".txt")==longitud_nombre-4;
   7: 
   8:         ...
   9: 
  10:     public String getDescription() {

View Full Code Here
   1: 
   2:   public static void main(String args[]) {
   3: 
   4:         ...
   5:         
   6:         String s = u.getFile();
   7:         ...
   8:         String classname = s.substring(s.lastIndexOf('/'), 
   9:         ...
  10:          s.lastIndexOf(".class"));

View Full Code Here
   1:     
   2:         public String
   3:     stringify( Object o )
   4:         ...
   5:         
   6:         final String    name    = constructor.getName();
   7:         ...
   8:         final int        lastDot    =     name.lastIndexOf( "." );
   9:         ...
  10:         final String    abbreviatedName    = name.substring( lastDot + 1, name.length() );

View Full Code Here
   1:     
   2:         public String
   3:     stringify( Object o )
   4:         ...
   5:         
   6:         final String    name    = constructor.getName();
   7:         ...
   8:         final int        lastDot    =     name.lastIndexOf( "." );
   9:         ...
  10:         final String    abbreviatedName    = name.substring( lastDot + 1, name.length() );

View Full Code Here

lastIndexOf

public int lastIndexOf(int ch,
                       int fromIndex)
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index. For values of ch in the range from 0 to 0xFFFF (inclusive), the index returned is the largest value k such that:
 (this.charAt(k) == ch) && (k <= fromIndex)
 
is true. For other values of ch, it is the largest value k such that:
 (this.codePointAt(k) == ch) && (k <= fromIndex)
 
is true. In either case, if no such character occurs in this string at or before position fromIndex, then -1 is returned.

All indices are specified in char values (Unicode code units).

Parameters:
ch - a character (Unicode code point).
fromIndex - the index to start the search from. There is no restriction on the value of fromIndex. If it is greater than or equal to the length of this string, it has the same effect as if it were equal to one less than the length of this string: this entire string may be searched. If it is negative, it has the same effect as if it were -1: -1 is returned.
Returns:
the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to fromIndex, or -1 if the character does not occur before that point.
Usages and Demos :

View More Examples of lastIndexOf(int ch,int fromIndex)
   1: 
   2:     public static String getAbstract(String text, int numOfChar)    {
   3:         try    {
   4:         ...
   5:             if (numOfChar < text.length())
   6:                 return text.substring(0, text.lastIndexOf(" ", numOfChar))+"...";
   7:             else
   8:                 return text;
   9:         } catch(Exception e)    {

View Full Code Here
   1: public class StringIndexMethods {
   2:    public static void main( String args[] ){
   3:         ...
   4:       String letters = "abcdefghabcdefgh";
   5:         ...
   6:       String output = "'c' is located at index " + letters.indexOf( 'c' );
   7:       output += "\n'a' is located at index " + letters.indexOf( 'a', 1 );
   8:         ...
   9:       output += "\nLast 'a' is located at index " +
  10:          letters.lastIndexOf( 'a', 10 );

View Full Code Here
   1:     public
   2:     String toString()
   3:     {
   4:         ...
   5:     {
   6:         String path = (String)candidate;
   7: 
   8:         ...
   9:                 break;
  10:             path = path.substring(0, path.lastIndexOf('/', start_rel - 1) + 1) +
  11:                    path.substring(start_rel + "/../".length());
  12:         ...
  13:         if(path.endsWith("/.."))
  14:             path = path.substring(0, path.lastIndexOf('/', path.length() - "x/..".length()) + 1);

View Full Code Here
   1: 
   2:     public static final String getContentType(String path) {
   3:         if (path == null) return null;
   4:         ...
   5: 
   6:         String ext =
   7:             (k >= 0 ? path.substring(j + 1, k): path.substring(j + 1))
   8:         ...
   9:         if ("dsp".equals(ext)) {
  10:             k = path.lastIndexOf('.', j - 1);
  11:             ext = path.substring(k + 1, j);

View Full Code Here
   1: 
   2:     public String buttonHtml(CmsWorkplace wp) {
   3: 
   4:         ...
   5:         if (getHelpText() == EMPTY_MESSAGE) {
   6:             String columns = "";
   7:             Iterator it = m_columns.iterator();
   8:         ...
   9:             }
  10:             if (columns.lastIndexOf(", ") > 0) {
  11:         ...
  12:                 columns = columns.substring(0, columns.lastIndexOf(", "))

View Full Code Here

lastIndexOf

public int lastIndexOf(String str)
Returns the index within this string of the rightmost occurrence of the specified substring. The rightmost empty string "" is considered to occur at the index value this.length(). The returned index is the largest value k such that
 this.startsWith(str, k)
 
is true.
Parameters:
str - the substring to search for.
Returns:
if the string argument occurs one or more times as a substring within this object, then the index of the first character of the last such substring is returned. If it does not occur as a substring, -1 is returned.
Usages and Demos :

View More Examples of lastIndexOf(String str)
   1:     public boolean accept(File f) {
   2:         String filename = f.getName();
   3:         int filenamelength = filename.length();
   4:         ...
   5:         return filename.lastIndexOf(".txt")==filenamelength-4;
   6:     }
   7:         ...
   8:     public String getDescription() {
   9:         return ".txt";

View Full Code Here
   1: 
   2:         String nombre_del_archivo = f.getName();
   3: 
   4:         ...
   5: 
   6:         return nombre_del_archivo.lastIndexOf(".txt")==longitud_nombre-4;
   7: 
   8:         ...
   9: 
  10:     public String getDescription() {

View Full Code Here
   1: 
   2:   public static void main(String args[]) {
   3: 
   4:         ...
   5:         
   6:         String s = u.getFile();
   7:         ...
   8:         String classname = s.substring(s.lastIndexOf('/'), 
   9:         ...
  10:          s.lastIndexOf(".class"));

View Full Code Here
   1:     
   2:         public String
   3:     stringify( Object o )
   4:         ...
   5:         
   6:         final String    name    = constructor.getName();
   7:         ...
   8:         final int        lastDot    =     name.lastIndexOf( "." );
   9:         ...
  10:         final String    abbreviatedName    = name.substring( lastDot + 1, name.length() );

View Full Code Here
   1:     
   2:         public String
   3:     stringify( Object o )
   4:         ...
   5:         
   6:         final String    name    = constructor.getName();
   7:         ...
   8:         final int        lastDot    =     name.lastIndexOf( "." );
   9:         ...
  10:         final String    abbreviatedName    = name.substring( lastDot + 1, name.length() );

View Full Code Here

lastIndexOf

public int lastIndexOf(String str,
                       int fromIndex)
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index. The integer returned is the largest value k such that:
     k <= Math.min(fromIndex, str.length()) && this.startsWith(str, k)
 
If no such value of k exists, then -1 is returned.
Parameters:
str - the substring to search for.
fromIndex - the index to start the search from.
Returns:
the index within this string of the last occurrence of the specified substring.
Usages and Demos :

View More Examples of lastIndexOf(String str,int fromIndex)
   1: 
   2:     public static String getAbstract(String text, int numOfChar)    {
   3:         try    {
   4:         ...
   5:             if (numOfChar < text.length())
   6:                 return text.substring(0, text.lastIndexOf(" ", numOfChar))+"...";
   7:             else
   8:                 return text;
   9:         } catch(Exception e)    {

View Full Code Here
   1: public class StringIndexMethods {
   2:    public static void main( String args[] ){
   3:         ...
   4:       String letters = "abcdefghabcdefgh";
   5:         ...
   6:       String output = "'c' is located at index " + letters.indexOf( 'c' );
   7:       output += "\n'a' is located at index " + letters.indexOf( 'a', 1 );
   8:         ...
   9:       output += "\nLast 'a' is located at index " +
  10:          letters.lastIndexOf( 'a', 10 );

View Full Code Here
   1:     public
   2:     String toString()
   3:     {
   4:         ...
   5:     {
   6:         String path = (String)candidate;
   7: 
   8:         ...
   9:                 break;
  10:             path = path.substring(0, path.lastIndexOf('/', start_rel - 1) + 1) +
  11:                    path.substring(start_rel + "/../".length());
  12:         ...
  13:         if(path.endsWith("/.."))
  14:             path = path.substring(0, path.lastIndexOf('/', path.length() - "x/..".length()) + 1);

View Full Code Here
   1: 
   2:     public static final String getContentType(String path) {
   3:         if (path == null) return null;
   4:         ...
   5: 
   6:         String ext =
   7:             (k >= 0 ? path.substring(j + 1, k): path.substring(j + 1))
   8:         ...
   9:         if ("dsp".equals(ext)) {
  10:             k = path.lastIndexOf('.', j - 1);
  11:             ext = path.substring(k + 1, j);

View Full Code Here
   1: 
   2:     public String buttonHtml(CmsWorkplace wp) {
   3: 
   4:         ...
   5:         if (getHelpText() == EMPTY_MESSAGE) {
   6:             String columns = "";
   7:             Iterator it = m_columns.iterator();
   8:         ...
   9:             }
  10:             if (columns.lastIndexOf(", ") > 0) {
  11:         ...
  12:                 columns = columns.substring(0, columns.lastIndexOf(", "))

View Full Code Here

length

public int length()
Returns the length of this string. The length is equal to the number of 16-bit Unicode characters in the string.
Specified by:
length in interface CharSequence
Returns:
the length of the sequence of characters represented by this object.
Usages and Demos :

View More Examples of length()
   1: {
   2:     private String begin, end;
   3:     
   4:         ...
   5:     
   6:     public Pages(String begin, String end)
   7:     {
   8:         ...
   9:     {
  10:         return begin != null && begin.length() != 0;
  11:     }
  12:         ...
  13:     {
  14:         return end != null && end.length() != 0;

View Full Code Here
   1:   private List field_ ;
   2:   private String term_ ;
   3:   private boolean matchAllFields_ = false ;
   4:         ...
   5:   
   6:   public String getTerm() { return term_ ; }
   7:         ...
   8:   public void   setTerm(String term) { term_ = term ; }
   9:   
  10:         ...
  11:   public boolean hasTerm() { 
  12:     return term_ != null  && term_.length() > 0;

View Full Code Here
   1: public class WanPipeAddress implements Address {
   2:     String logical_name=null;
   3:     static final Log log=LogFactory.getLog(WanPipeAddress.class);
   4:         ...
   5: 
   6:     public WanPipeAddress(String logical_name) {
   7:         this.logical_name=logical_name;
   8:         ...
   9:     public int size() {
  10:         return logical_name != null? logical_name.length()+2 : 22;
  11:     }
  12:         ...
  13: 
  14:     public String toString() {

View Full Code Here
   1: 
   2:     public EncryptMetaData(byte[] encrypted_data, LocalIdentity myId, String recipient) {
   3: 
   4:         ...
   5:         }
   6:         assert recipient != null && recipient.length() > 0;
   7:     }
   8:         ...
   9: 
  10:     public String getRecipient() {
  11:         return recipient;

View Full Code Here
   1:     private static final long serialVersionUID = 1L;
   2:     private String fImagePath;
   3:         ...
   4:     private String fAboutText;
   5: 
   6:         ...
   7: 
   8:     public void setText(String text) {
   9:         String old = fAboutText;
  10:         ...
  11:     private boolean isAboutTextDefined() {
  12:         return fAboutText != null && fAboutText.length() > 0;

View Full Code Here

matches

public boolean matches(String regex)
Tells whether or not this string matches the given regular expression.

An invocation of this method of the form str.matches(regex) yields exactly the same result as the expression

Pattern.matches(regex, str)
Parameters:
regex - the regular expression to which this string is to be matched
Returns:
true if, and only if, this string matches the given regular expression
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
Usages and Demos :

View More Examples of matches(String regex)
   1: {
   2:     private String id;
   3:         ...
   4:     private String value;
   5:     private List<Entry> sequenceFor;
   6:         ...
   7:     private List<String> clusters;
   8:     
   9:         ...
  10:     {
  11:         return id.matches("UPI[0-9A-F]{10}");

View Full Code Here
   1: {
   2:   public SimpleVariableExpressionTest(String name)
   3:   {
   4:         ...
   5:   {
   6:     String VARNAME = "aVar";
   7:         ...
   8:     String value = new String( "aValue" );
   9:     context.setAttribute(VARNAME,value, RuleContext.LOCAL_SCOPE );
  10:         ...
  11:     String regexp = "[\\w]+";
  12:     assertTrue( "is a name",  name.matches(regexp) );

View Full Code Here
   1:                  Object userObject,
   2:                  String mimeType) {
   3:         ...
   4:     if (userObject instanceof String) {
   5:         ...
   6:         if (mimeType.matches(".*chemical/x-pdb.*") ||
   7:         ...
   8:         mimeType.matches(".*chemical/x-mdl-molfile.*") ||

View Full Code Here
   1: 
   2:   public Map <String, String> staticMap = new HashMap<String,String>();
   3: 
   4:         ...
   5:     {
   6:         for (String pureMeth: ChicoryPremain.getPureMethods())
   7:         {
   8:         ...
   9:   {
  10:       return methodName.matches(".*" + class_name + ".*\\(.*");
  11:   }

View Full Code Here
   1: 
   2:     private String id;
   3:         ...
   4:     private String description = "";
   5:         ...
   6:     private String name = "";
   7:     
   8:         ...
   9:     public static boolean isValidId(String id) {
  10:         return id != null && id.matches("\\w+");

View Full Code Here

offsetByCodePoints

public int offsetByCodePoints(int index,
                              int codePointOffset)
Returns the index within this String that is offset from the given index by codePointOffset code points. Unpaired surrogates within the text range given by index and codePointOffset count as one code point each.
Parameters:
index - the index to be offset
codePointOffset - the offset in code points
Returns:
the index within this String
Throws:
IndexOutOfBoundsException - if index is negative or larger then the length of this String, or if codePointOffset is positive and the substring starting with index has fewer than codePointOffset code points, or if codePointOffset is negative and the substring before index has fewer than the absolute value of codePointOffset code points.
Since:
1.5

regionMatches

public boolean regionMatches(boolean ignoreCase,
                             int toffset,
                             String other,
                             int ooffset,
                             int len)
Tests if two string regions are equal.

A substring of this String object is compared to a substring of the argument other. The result is true if these substrings represent character sequences that are the same, ignoring case if and only if ignoreCase is true. The substring of this String object to be compared begins at index toffset and has length len. The substring of other to be compared begins at index ooffset and has length len. The result is false if and only if at least one of the following is true:

  • toffset is negative.
  • ooffset is negative.
  • toffset+len is greater than the length of this String object.
  • ooffset+len is greater than the length of the other argument.
  • ignoreCase is false and there is some nonnegative integer k less than len such that:
     this.charAt(toffset+k) != other.charAt(ooffset+k)
     
  • ignoreCase is true and there is some nonnegative integer k less than len such that:
     Character.toLowerCase(this.charAt(toffset+k)) !=
    Character.toLowerCase(other.charAt(ooffset+k))
     
    and:
     Character.toUpperCase(this.charAt(toffset+k)) !=
             Character.toUpperCase(other.charAt(ooffset+k))
     
Parameters:
ignoreCase - if true, ignore case when comparing characters.
toffset - the starting offset of the subregion in this string.
other - the string argument.
ooffset - the starting offset of the subregion in the string argument.
len - the number of characters to compare.
Returns:
true if the specified subregion of this string matches the specified subregion of the string argument; false otherwise. Whether the matching is exact or case insensitive depends on the ignoreCase argument.
Usages and Demos :

View More Examples of regionMatches(boolean ignoreCase,int toffset,String other,int ooffset,int len)
   1: 
   2:     public static boolean startsWithIgnoreCase(final String base, final String start) {
   3:         if (base.length() < start.length()) {
   4:         ...
   5:         }
   6:         return base.regionMatches(true, 0, start, 0, start.length());
   7:     }
   8:         ...
   9: 
  10:     public static boolean endsWithIgnoreCase(final String base, final String end) {
  11:         if (base.length() < end.length()) {

View Full Code Here
   1: 
   2:   public static boolean startsWithIgnoreCase (final String base, final String start)
   3:   {
   4:         ...
   5:     }
   6:     return base.regionMatches(true, 0, start, 0, start.length());
   7:   }
   8:         ...
   9: 
  10:   public static boolean endsWithIgnoreCase (final String base, final String end)
  11:   {

View Full Code Here
   1: public class Regexp {
   2:     public String exp;
   3:         ...
   4:     public String prefix, suffix;
   5:     public boolean exact;
   6:         ...
   7:     public int prefixLen, suffixLen, totalLen;
   8:     public String mids[];
   9: 
  10:         ...
  11:         return len == totalLen &&
  12:         exp.regionMatches(ignoreCase, 0, s, offset, len);

View Full Code Here
   1: 
   2:   public static final Type getInstance(final String s) {
   3:     TypeImpl ti = new TypeImpl();
   4:         ...
   5:   public static final Type getInstance(
   6:       final boolean xnot, final String classname) {
   7:     TypeImpl ti = new TypeImpl();
   8:         ...
   9: 
  10:   private final void setClass(String s) {
  11:     if (!(s.startsWith("is:"))) {
  12:         ...
  13:     boolean xnot = false;
  14:     while ((i < slen) && s.regionMatches(true, i, "not:", 0, 4)) {

View Full Code Here
   1: public class StringMatcher {
   2:     protected String fPattern;
   3:     protected boolean fIgnoreWildCards;
   4:         ...
   5: 
   6:     public StringMatcher(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
   7:         if (pattern == null)
   8:         ...
   9:     }
  10:     public StringMatcher.Position find(String text, int start, int end) {
  11:         if (text == null)
  12:         ...
  13:         if (fIgnoreWildCards)
  14:             return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength);

View Full Code Here

regionMatches

public boolean regionMatches(int toffset,
                             String other,
                             int ooffset,
                             int len)
Tests if two string regions are equal.

A substring of this String object is compared to a substring of the argument other. The result is true if these substrings represent identical character sequences. The substring of this String object to be compared begins at index toffset and has length len. The substring of other to be compared begins at index ooffset and has length len. The result is false if and only if at least one of the following is true:

  • toffset is negative.
  • ooffset is negative.
  • toffset+len is greater than the length of this String object.
  • ooffset+len is greater than the length of the other argument.
  • There is some nonnegative integer k less than len such that: this.charAt(toffset+k) != other.charAt(ooffset+k)
Parameters:
toffset - the starting offset of the subregion in this string.
other - the string argument.
ooffset - the starting offset of the subregion in the string argument.
len - the number of characters to compare.
Returns:
true if the specified subregion of this string exactly matches the specified subregion of the string argument; false otherwise.
Usages and Demos :

View More Examples of regionMatches(int toffset,String other,int ooffset,int len)
   1: public class RegionMatchesDemo {
   2:     public static void main(String[] args) {
   3: 
   4:         ...
   5:         String searchMe = "Green Eggs and Ham";
   6:         ...
   7:         String findMe = "Eggs";
   8:         int len = findMe.length();
   9:         ...
  10:         int i = 0;
  11:         while (!searchMe.regionMatches(i, findMe, 0, len)) {

View Full Code Here
   1:         {
   2:             String name1 = c1.getName();
   3:         ...
   4:             String name2 = c2.getName();
   5:             int lastdot1 = name1.lastIndexOf('.');
   6:         ...
   7:             {
   8:                 return lastdot1 == -1 || name1.regionMatches(0, name2, 0, lastdot1);
   9:             }

View Full Code Here
   1: 
   2:     String path = req.getRequestURI();
   3:     int startIdx = 2; 
   4:         ...
   5:           (ch == '%') &&
   6:           path.regionMatches(startIdx + 1, "7E", 0, 2)) {
   7:         startIdx += 3;
   8:         ...
   9:     }
  10:     String encName = path.substring(startIdx, sepIdx);
  11: 
  12:         ...
  13:     String scheme = req.getScheme();

View Full Code Here
   1: 
   2:   protected String string;
   3:   protected int hashCode;
   4:         ...
   5: 
   6:   protected ESString(String string)
   7:   {
   8:         ...
   9:   { 
  10:     return string.regionMatches(i, test, j, len);
  11:   }
  12:         ...
  13:     for (int i = 0; i <= len; i++) {
  14:       if (string.regionMatches(i, sb.string, 0, sb.length()))

View Full Code Here

replace

public String replace(char oldChar,
                      char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.

If the character oldChar does not occur in the character sequence represented by this String object, then a reference to this String object is returned. Otherwise, a new String object is created that represents a character sequence identical to the character sequence represented by this String object, except that every occurrence of oldChar is replaced by an occurrence of newChar.

Examples:

 "mesquite in your cellar".replace('e', 'o')
         returns "mosquito in your collar"
 "the war of baronets".replace('r', 'y')
         returns "the way of bayonets"
 "sparring with a purple porpoise".replace('p', 't')
         returns "starring with a turtle tortoise"
 "JonL".replace('q', 'x') returns "JonL" (no change)
 
Parameters:
oldChar - the old character.
newChar - the new character.
Returns:
a string derived from this string by replacing every occurrence of oldChar with newChar.
Usages and Demos :

View More Examples of replace(char oldChar,char newChar)
   1: 
   2:     public static String substitute(final String command, final Member member) {
   3:         ...
   4:         return command.replace("%host", member.getHost().toString()).replace(
   5:                 "%user", member.getUserName());
   6:     }

View Full Code Here
   1: 
   2:             String[] f = u.getLabels();
   3:             for (int i=0; i<u.getNF(); i++) {
   4:         ...
   5:                 String element = f[i];
   6:                 if (element == null || element.length() == 0)
   7:         ...
   8:                     continue;
   9:                 String value = u.f[i].getValue();
  10:                 if (value == null || value.length() == 0)
  11:         ...
  12:                 Element e = doc.createElement(
  13:                     element.replace(' ', '_'));

View Full Code Here
   1: public class QueryEncoder {
   2:     public static String encodeForQuery(Value value) {
   3:         if(value instanceof Resource) {
   4:         ...
   5:     }
   6:     public static String encodeLiteral(Literal literal) {
   7:         if(literal.getDatatype()!=null) {
   8:         ...
   9:     }
  10:     public static String encodeRegex(String literal) {
  11:         ...
  12:         return literal.replace("$", "\\\\$");

View Full Code Here
   1: 
   2:     protected String visitIdentifier(String identifier) {
   3:         ...
   4:         return identifier.replace('+', '$');
   5:     }
   6:         ...
   7: 
   8:     protected String visitInternalName(String name) {
   9:         return locator.getClassName(name);

View Full Code Here
   1:   public static final void setPackages(Collection c) {
   2:     packages = new String[c.size()];
   3:     Iterator iter = c.iterator(); 
   4:         ...
   5:       Object oi = iter.next();
   6:       if (!(oi instanceof String)) {
   7:         ...
   8:         throw new ClassCastException("Expecting \"String\" packages");
   9:       }
  10:         ...
  11:     }
  12:     return s.replace('$', '.');

View Full Code Here

replace

public String replace(CharSequence target,
                      CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab".
Parameters:
target - The sequence of char values to be replaced
replacement - The replacement sequence of char values
Returns:
The resulting string
Throws:
NullPointerException - if target or replacement is null.
Since:
1.5
Usages and Demos :

View More Examples of replace(CharSequence target,CharSequence replacement)
   1: 
   2:     public static String substitute(final String command, final Member member) {
   3:         ...
   4:         return command.replace("%host", member.getHost().toString()).replace(
   5:                 "%user", member.getUserName());
   6:     }

View Full Code Here
   1: 
   2:             String[] f = u.getLabels();
   3:             for (int i=0; i<u.getNF(); i++) {
   4:         ...
   5:                 String element = f[i];
   6:                 if (element == null || element.length() == 0)
   7:         ...
   8:                     continue;
   9:                 String value = u.f[i].getValue();
  10:                 if (value == null || value.length() == 0)
  11:         ...
  12:                 Element e = doc.createElement(
  13:                     element.replace(' ', '_'));

View Full Code Here
   1: public class QueryEncoder {
   2:     public static String encodeForQuery(Value value) {
   3:         if(value instanceof Resource) {
   4:         ...
   5:     }
   6:     public static String encodeLiteral(Literal literal) {
   7:         if(literal.getDatatype()!=null) {
   8:         ...
   9:     }
  10:     public static String encodeRegex(String literal) {
  11:         ...
  12:         return literal.replace("$", "\\\\$");

View Full Code Here
   1: 
   2:     protected String visitIdentifier(String identifier) {
   3:         ...
   4:         return identifier.replace('+', '$');
   5:     }
   6:         ...
   7: 
   8:     protected String visitInternalName(String name) {
   9:         return locator.getClassName(name);

View Full Code Here
   1:   public static final void setPackages(Collection c) {
   2:     packages = new String[c.size()];
   3:     Iterator iter = c.iterator(); 
   4:         ...
   5:       Object oi = iter.next();
   6:       if (!(oi instanceof String)) {
   7:         ...
   8:         throw new ClassCastException("Expecting \"String\" packages");
   9:       }
  10:         ...
  11:     }
  12:     return s.replace('$', '.');

View Full Code Here

replaceAll

public String replaceAll(String regex,
                         String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement.

An invocation of this method of the form str.replaceAll(regex, repl) yields exactly the same result as the expression

Pattern.compile(regex).matcher(str).replaceAll(repl)
Parameters:
regex - the regular expression to which this string is to be matched
Returns:
The resulting String
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
Usages and Demos :

View More Examples of replaceAll(String regex,String replacement)
   1: public class Bowdlerize {
   2:   public static String bleep(String input) {
   3:         ...
   4:     return input.replaceAll("\\b\\w{4}\\b", "(bleep)");
   5:   }
   6: }

View Full Code Here
   1: public class QueryEncoder {
   2:     public static String encodeForQuery(Value value) {
   3:         if(value instanceof Resource) {
   4:         ...
   5: 
   6:     public static String encodeForQuery(String literalString) {
   7:         ...
   8:         return literalString.replaceAll("\\\\", "\\\\\\\\").replaceAll("\b", "\\\\b").replaceAll("\t", "\\\\t").replaceAll("\n", "\\\\n")
   9:         ...
  10:         .replaceAll("\r", "\\\\r").replaceAll("\"", "\\\\\"").replaceAll("\'", "\\\\'");

View Full Code Here
   1:         Object obj = literal.getValue();
   2:         if (!(obj instanceof String)) {
   3:             return literal;
   4:         ...
   5:         Object obj = literal.getValue();
   6:         if (!(obj instanceof String)) {
   7:             return literal;
   8:         ...
   9:         if (node.isLiteral()) {
  10:             if (!(node.getLiteral().getValue() instanceof String))
  11:                 return node;
  12:         ...
  13:     public static String encodeForQuery(String literalString) {
  14:         return literalString.replaceAll("\\\\", "\\\\\\\\").replaceAll("\b", "\\\\b").replaceAll("\t", "\\\\t").replaceAll("\n", "\\\\n")

View Full Code Here
   1:         
   2:         public void addHeader(String s) {
   3:             openRow();
   4:         ...
   5:         
   6:         public void addMessage(String s) {
   7:             openRow();
   8:         ...
   9:         
  10:         public String toHtml() {
  11:             return m_sb.toString();

View Full Code Here
   1: 
   2:     public String getClassDependencyGraph() {
   3: 
   4:         ...
   5: 
   6:     private String sortLines(HashSet lines) {
   7:         ArrayList list = new ArrayList(lines);
   8:         ...
   9: 
  10:         String dependencies = "";
  11:         for (Iterator iterator = list.iterator(); iterator.hasNext();) {
  12:         ...
  13:         }
  14:         return dependencies.replaceAll("'","\"");

View Full Code Here

replaceFirst

public String replaceFirst(String regex,
                           String replacement)
Replaces the first substring of this string that matches the given regular expression with the given replacement.

An invocation of this method of the form str.replaceFirst(regex, repl) yields exactly the same result as the expression

Pattern.compile(regex).matcher(str).replaceFirst(repl)
Parameters:
regex - the regular expression to which this string is to be matched
Returns:
The resulting String
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
Usages and Demos :

View More Examples of replaceFirst(String regex,String replacement)
   1: public class Replacing {
   2:   static String s = Splitting.knights;
   3:         ...
   4:   public static void main(String[] args) {
   5:         ...
   6:     print(s.replaceFirst("f\\w+", "located"));
   7:     print(s.replaceAll("shrubbery|tree|herring","banana"));

View Full Code Here
   1: public class VelocityTool extends net.yher2.commons.velocity.VelocityTool {
   2:     public String image(String imgFile, int size) {
   3:         return image(imgFile, size, true);
   4:         ...
   5:     }
   6:     public String image(String imgFile, int size, boolean active) {
   7:         if (StringUtils.isBlank(imgFile)) return "";
   8:         ...
   9:         String suffix = Integer.toString(size) + (active ? "" : "-off");
  10:         return imgFile.replaceFirst("\\.", suffix + ".");
  11:     }

View Full Code Here
   1:     
   2:     public String toString(Object obj) {
   3:         ...
   4:         String s = super.toString(obj);
   5:         ...
   6:         return s.replaceFirst(":\\?\\?\\?", "");
   7:     }
   8:         ...
   9: 
  10:     public Object fromString(String str) {

View Full Code Here
   1: 
   2:     public Query parseQuery(String query) throws ParserException {
   3:         ...
   4:         String uQuery = query.toUpperCase();
   5:         try {
   6:         ...
   7:     
   8:     private SelectionQuery getSelectionQuery(String query) throws ParserException {
   9:         Parser parser = ParserService.getInstance().getParser();

View Full Code Here
   1: {
   2:     public static String pluralize(String word)
   3:     {
   4:         ...
   5:             final Map.Entry rule = (Map.Entry)ruleIterator.next();
   6:             final String pattern = rule.getKey().toString();
   7:             final String replace = rule.getValue().toString();
   8:         ...
   9:             {
  10:                 return word.replaceFirst(pattern, replace);
  11:             }
  12:         ...
  13:             {
  14:                 return word.replaceFirst(pattern, replace);

View Full Code Here

split

public String[] split(String regex)
Splits this string around matches of the given regular expression.

This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array.

The string "boo:and:foo", for example, yields the following results with these expressions:

RegexResult
:{ "boo", "and", "foo" }
o{ "b", "", ":and:f" }
Parameters:
regex - the delimiting regular expression
Returns:
the array of strings computed by splitting this string around matches of the given regular expression
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
Usages and Demos :

View More Examples of split(String regex)
   1: 
   2:     public static String[] split(String string, String delimiters) {
   3:         try {
   4:         ...
   5:             return string.split(delimiters);
   6:         } catch (NoSuchMethodError e) {
   7:         ...
   8:             List result = new ArrayList();
   9:             for (StringTokenizer tokenizer = new StringTokenizer(string, delimiters); tokenizer.hasMoreTokens(); )
  10:                 result.add(tokenizer.nextToken());

View Full Code Here
   1: 
   2:     private String matcherName;
   3: 
   4:         ...
   5: 
   6:     public MockMatcherConfig(String matcherName, MailetContext mc) {
   7:         super();
   8:         ...
   9: 
  10:     public String getCondition() {
  11:         if (matcherName.indexOf("=") >= 0) {
  12:         ...
  13:         if (matcherName.indexOf("=") >= 0) {
  14:             return matcherName.split("=")[0];

View Full Code Here
   1:     
   2:     Form(DbSession parent,String name) throws DataStoreException{
   3:         this.parent=parent;
   4:         ...
   5:         String[] ar=name.split("\\.");
   6:         tobj = new Table(parent,"system.Forms");
   7:         ...
   8:             tobj.close();
   9:             throw new DataStoreException("formNotFound", new String[] {name});
  10:         }

View Full Code Here
   1:     
   2:     Report(DbSession parent,String name) throws DataStoreException{
   3:         this.parent=parent;
   4:         ...
   5:         String[] ar=name.split("\\.");
   6:         tobj = parent.openTable("system.Reports");
   7:         ...
   8:             tobj.close();
   9:             throw new DataStoreException("reportNotFound", new String[] {name});
  10:         }

View Full Code Here
   1:   {
   2:     String query = (String)input;
   3:         ...
   4:     String delim = (String)getParameter("delim","\\s");
   5: 
   6:         ...
   7:     return query.split(delim);
   8:   }

View Full Code Here

split

public String[] split(String regex,
                      int limit)
Splits this string around matches of the given regular expression.

The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the string. The substrings in the array are in the order in which they occur in this string. If the expression does not match any part of the input then the resulting array has just one element, namely this string.

The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than zero then the pattern will be applied at most n - 1 times, the array's length will be no greater than n, and the array's last entry will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.

The string "boo:and:foo", for example, yields the following results with these parameters:

RegexLimitResult
:2{ "boo", "and:foo" }
:5{ "boo", "and", "foo" }
:-2{ "boo", "and", "foo" }
o5{ "b", "", ":and:f", "", "" }
o-2{ "b", "", ":and:f", "", "" }
o0{ "b", "", ":and:f" }

An invocation of this method of the form str.split(regex, n) yields the same result as the expression

Pattern.compile(regex).split(str, n)
Parameters:
regex - the delimiting regular expression
limit - the result threshold, as described above
Returns:
the array of strings computed by splitting this string around matches of the given regular expression
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
Usages and Demos :

View More Examples of split(String regex,int limit)
   1:   
   2:   public ObjectClassAttributes(String[] classes) {
   3:     setClasses(classes) ;
   4:         ...
   5:   
   6:   public void setClasses(String[] classes) {
   7:     BasicAttribute attr  = new BasicAttribute("objectClass") ;
   8:         ...
   9:     for(String clazz:  classes ) attr.add(clazz) ;
  10:     put(attr) ;
  11:         ...
  12:   public void setClasses(String classes) {
  13:     String[] clazz = classes.split(",") ;

View Full Code Here
   1:     
   2:     public void setText(String txt) {
   3:         if (txt == null)
   4:         ...
   5:             txt = txt.trim();
   6:             String[] entries = txt.split(",");
   7:             Map newMap = new HashMap();
   8:         ...
   9:             {
  10:                 String key = entries[i].substring(0, entries[i].indexOf('=')-1);
  11:         ...
  12:                 String value = entries[i].substring(entries[i].indexOf('='));

View Full Code Here
   1:   {
   2:     return String[].class;
   3:   }
   4:         ...
   5:   
   6:   public Object valueOf(String text)
   7:   {
   8:         ...
   9:     return text.split(",");
  10:   }
  11:         ...
  12:   {
  13:     if (value instanceof String[])

View Full Code Here
   1: public abstract class StringUtils extends org.springframework.util.StringUtils {
   2:     public static List<String> convertFromCommaDelimitedString(
   3:         ...
   4:             final String p_string) {
   5:         ...
   6:         List<String> retVal = new ArrayList<String>();
   7:         ...
   8:         String[] arrayString = p_string.split(",");

View Full Code Here
   1: public class CheckIsAccessible extends Checker {
   2:     public static void main(String... args) throws Exception {
   3:         Checker chk = new CheckIsAccessible();
   4:         ...
   5:     @Override
   6:     protected boolean check(Scope s, String ref) {
   7:     System.err.println("checkIsAccessible: " + s + " " + s.getEnclosingClass() + " " + ref);
   8:         ...
   9:     Trees trees = getTrees();
  10:     String[] args = ref.split(" +", 3);
  11:     boolean expect = args[args.length - 1].equals("yes");
  12:         ...
  13: 
  14:     private TypeElement getTypeElement(String name) {

View Full Code Here

startsWith

public boolean startsWith(String prefix)
Tests if this string starts with the specified prefix.
Parameters:
prefix - the prefix.
Returns:
true if the character sequence represented by the argument is a prefix of the character sequence represented by this string; false otherwise. Note also that true will be returned if the argument is an empty string or is equal to this String object as determined by the equals(Object) method.
Since:
1. 0
Usages and Demos :

View More Examples of startsWith(String prefix)
   1: 
   2:    public boolean acceptsURL(String string) throws SQLException {
   3:         ...
   4:       return string != null && string.startsWith("jdbc:jboss-test-adapter");
   5:    }
   6:         ...
   7: 
   8:    public Connection connect(String url, Properties info) throws SQLException
   9:    {

View Full Code Here
   1: public class Token {
   2:     String m_str;
   3:     int m_start_pos, m_end_pos;
   4:         ...
   5:     Token(String str, int start_pos, int end_pos){
   6:         m_str=str;
   7:         ...
   8:         
   9:     static List<Token> parseExpressionToken(String text){
  10:         StringTokenizer tk=new StringTokenizer(text,sTerminators,true),tk1=null;
  11:         ...
  12:     public boolean isTag(){
  13:         return m_str!=null&&m_str.startsWith("<")&&m_str.endsWith(">");

View Full Code Here
   1: {
   2:     private String id;
   3:         ...
   4:     private String sequenceId;
   5:         ...
   6:     private String mnemonic;
   7:     private boolean reviewed;
   8:         ...
   9:     {
  10:         return id != null && !id.startsWith("UPI");

View Full Code Here
   1: 
   2:     public static URL resolve(String s)
   3:     throws MalformedURLException
   4:         ...
   5:         resolve = new URL(s);
   6:     } else if (s.startsWith(File.separator) ||
   7:         ...
   8:             s.startsWith("/") ||
   9:         (s.length() >= 2 &&
  10:         ...
  11:          s.charAt(1) == ':')) {
  12:             String fName = s;

View Full Code Here
   1: 
   2:     public Enumeration getResources(String name) throws IOException {
   3:         name = resolveName(name);
   4:         ...
   5:     }
   6:     public List getDependentXmlResources(String name, String elName,
   7:     String elDepends) throws IOException {
   8:         ...
   9:     private static String resolveName(String name) {
  10:         return name != null && name.startsWith("/") ?
  11:             name.substring(1): name;

View Full Code Here

startsWith

public boolean startsWith(String prefix,
                          int toffset)
Tests if this string starts with the specified prefix beginning a specified index.
Parameters:
prefix - the prefix.
toffset - where to begin looking in the string.
Returns:
true if the character sequence represented by the argument is a prefix of the substring of this object starting at index toffset; false otherwise. The result is false if toffset is negative or greater than the length of this String object; otherwise the result is the same as the result of the expression
this.substring(toffset).startsWith(prefix)
Usages and Demos :

View More Examples of startsWith(String prefix,int toffset)
   1: 
   2:     public void setBeanNames(String[] beanNames) {
   3:         this.beanNames = Arrays.asList(beanNames);
   4:         ...
   5: 
   6:     protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) {
   7:         if (this.beanNames != null) {
   8:         ...
   9:             for (Iterator it = this.beanNames.iterator(); it.hasNext();) {
  10:                 String mappedName = (String) it.next();
  11:                 if (isMatch(beanName, mappedName)) {
  12:         ...
  13:     protected boolean isMatch(String beanName, String mappedName) {
  14:         return (mappedName.endsWith("*") && beanName.startsWith(mappedName.substring(0, mappedName.length() - 1))) ||

View Full Code Here
   1: 
   2:     public static URL relative( URL context, String spec )
   3:                                         throws MalformedURLException
   4:         ...
   5:     {    
   6:         String path           = context.getPath();
   7:         ...
   8:         String originalPath = path;
   9:         String originalSpec = spec;
  10:         ...
  11: 
  12:         while( spec.startsWith("..", specStart) )

View Full Code Here
   1: 
   2:         String  name = cipher.getAlgorithmName();
   3:         int     idx = name.indexOf('/') + 1;
   4:         ...
   5: 
   6:         pgpCFB = (idx > 0 && name.startsWith("PGP", idx));
   7: 
   8:         ...
   9:         {
  10:             partialBlockOkay = (idx > 0 && (name.startsWith("CFB", idx) || name.startsWith("OFB", idx) || name.startsWith("OpenPGP", idx) || name.startsWith("SIC", idx)));
  11:         }

View Full Code Here
   1:    {
   2:       protected String name;
   3: 
   4:         ...
   5:             Module module = (Module) member;
   6:             String processName = module.getProcessName();
   7:         ...
   8:             String MObjectType = module.getMObjectType();
   9:             result = processName != null && MObjectType != null && MObjectType.equals(type);
  10:         ...
  11:                   {
  12:                      result = name.startsWith( processName.substring(0,idx) );

View Full Code Here
   1: 
   2:     String hw1 = "HelloWorld";
   3: 
   4:         ...
   5:     String hw2 = "HelloWorld";
   6: 
   7:         ...
   8:     String hwlc = "helloworld";
   9: 
  10:         ...
  11:     public void test_startsWithLjava_lang_StringI() {
  12:         assertTrue("Failed to find string", hw1.startsWith("World", 5));

View Full Code Here

subSequence

public CharSequence subSequence(int beginIndex,
                                int endIndex)
Returns a new character sequence that is a subsequence of this sequence.

An invocation of this method of the form

 str.subSequence(begin, end)
behaves in exactly the same way as the invocation
 str.substring(begin, end)
This method is defined so that the String class can implement the CharSequence interface.
Specified by:
subSequence in interface CharSequence
Parameters:
beginIndex - the begin index, inclusive.
endIndex - the end index, exclusive.
Returns:
the specified subsequence.
Throws:
IndexOutOfBoundsException - if beginIndex or endIndex are negative, if endIndex is greater than length(), or if beginIndex is greater than startIndex
Since:
1.4
Usages and Demos :

View More Examples of subSequence(int beginIndex,int endIndex)
   1: {
   2:   static void out( String s, BreakIterator iter )
   3:   {
   4:         ...
   5:     {
   6:       System.out.println( s.subSequence( last, next ) );
   7:       last = next;
   8:         ...
   9: 
  10:   public static void main( String[] args )
  11:   {
  12:         ...
  13:     String helmutKohl = "Ich wei?, dass ich 1945 f?nfzehn war und 1953 achtzehn.";

View Full Code Here
   1: 
   2:     public boolean isMethodMatch(String methodName) {
   3:         ...
   4:         return this.pattern.matcher(methodName.subSequence(0, methodName.length())).matches();
   5:     }
   6:         ...
   7: 
   8:     public abstract Object invoke(Class clazz, String methodName, Object[] arguments);
   9: 
  10:         ...
  11:     public String toString() {

View Full Code Here
   1:     
   2:     private final String _name;
   3:     
   4:         ...
   5:     public CharSequence subSequence(int start, int end) {
   6:         return _name.subSequence(start, end);
   7:     }
   8:         ...
   9:     @Override
  10:     public String toString() {
  11:         return _name;

View Full Code Here
   1:     private static final long serialVersionUID = -2853908867414076703L;
   2:     private String value;
   3: 
   4:         ...
   5:     public TextField(String value) {
   6:         this.value = TextUtils.replaceAll("\r\n", value, "\n").trim();
   7:         ...
   8:     public CharSequence subSequence(int start, int end) {
   9:         return value.subSequence(start, end);
  10:     }
  11:         ...
  12: 
  13:     public String toString() {

View Full Code Here
   1:     private int indentAmount = 4;
   2:     private String indentChars = "                                                                                           ";
   3:     private int level = 0;
   4:         ...
   5:     
   6:     public void startElement(String qname) throws TransformerException {
   7:         if(afterTag)
   8:         ...
   9:     
  10:     public void endElement(String qname) throws TransformerException {
  11:         level--;
  12:         ...
  13:         super.characters("\n");
  14:         super.characters(indentChars.subSequence(0, spaces));

View Full Code Here

substring

public String substring(int beginIndex)
Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string.

Examples:

 "unhappy".substring(2) returns "happy"
 "Harbison".substring(3) returns "bison"
 "emptiness".substring(9) returns "" (an empty string)
 
Parameters:
beginIndex - the beginning index, inclusive.
Returns:
the specified substring.
Throws:
IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object.
Usages and Demos :

View More Examples of substring(int beginIndex)
   1: 
   2:     public static String parseAppName(String uniqueName)
   3:     {
   4:         ...
   5: 
   6:     public static String parsePortletName(String uniqueName)
   7:     {
   8:         ...
   9:         int split = splitUniqueName(uniqueName);
  10:         return uniqueName.substring((split + 2), uniqueName.length());
  11:     }

View Full Code Here
   1: 
   2:     String auth = request.getHeader("Authorization");
   3:         ...
   4:     String login = "", password = "";
   5: 
   6:         ...
   7:     if (auth != null) {
   8:       auth = new String(Base64.decode(auth.substring(auth.indexOf(' ') + 1)));
   9:       login = auth.substring(0, auth.indexOf(':'));
  10:         ...
  11:       password = auth.substring(auth.indexOf(':') + 1);

View Full Code Here
   1:     StringBuffer sequenceBuffer = new StringBuffer();
   2:     String line = in.readLine();
   3:     while (null != line && line.length() < 8
   4:         ...
   5:         int last = line.lastIndexOf(' ');
   6:         String name = line.substring(0, first).trim();
   7:         if (0 < name.length()) {
   8:         ...
   9:             SequenceI seq = (SequenceI) o;
  10:             seq.appendResidues(line.substring(last).trim().replace('-', MultiSeqAlign.GAP_CHAR));
  11:           }
  12:         ...
  13:           else {
  14:             String seq = new String(line.substring(last).trim().replace('-', MultiSeqAlign.GAP_CHAR));

View Full Code Here
   1:         
   2:         String tmp = (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);
   3:         if ( tmp != null ) tmp = tmp.trim();
   4:         ...
   5:         if ( tmp != null && tmp.startsWith("Basic ") ) {
   6:             String user=null ;
   7:             int  i ;
   8:         ...
   9: 
  10:             tmp = new String( Base64.decode( tmp.substring(6) ) );
  11:             i = tmp.indexOf( ':' );
  12:         ...
  13:             if ( i != -1 )  {
  14:                 String pwd = tmp.substring(i+1);

View Full Code Here
   1: 
   2:     public String getName() {
   3:         return "XSLTResults";
   4:         ...
   5:     }
   6:     public String getDescription() {
   7:         return "XSL Transformation Results";
   8:         ...
   9:     }
  10:     private String getKey(Source xsl, Map params, Properties props, Document src) {        
  11:         StringBuffer key = new StringBuffer(""+(xsl.getSystemId() + "/" + (params != null ? params.toString() : "")  + "/" + (props != null ? props.toString() : "")+ "/"));
  12:         ...
  13:                     if (log.isDebugEnabled()) {
  14:                         log.debug("xslt Result of key " + key.substring(100) + " is too big to put in cache. " + result.length() + " >= " +  getMaxEntrySize());

View Full Code Here

substring

public String substring(int beginIndex,
                        int endIndex)
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

Examples:

 "hamburger".substring(4, 8) returns "urge"
 "smiles".substring(1, 5) returns "mile"
 
Parameters:
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
Returns:
the specified substring.
Throws:
IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex.
Usages and Demos :

View More Examples of substring(int beginIndex,int endIndex)
   1: 
   2:     public SubscriberPresence(String fromURI, Dialog d, int exp, boolean part) {
   3:     super(fromURI,d,exp);
   4:         ...
   5:     int at = fromURI.indexOf("@");
   6:     String fileName = new String(fromURI.substring(colon,at) + File.separator + 
   7:                      "filter.xml"); 
   8:         ...
   9: 
  10:     public void updateNotifyBody(String newString) {
  11:     notifyBody = newString;

View Full Code Here
   1:   }
   2: public String toString()
   3:   {
   4:         ...
   5:   }
   6: protected void decode(String content)
   7:     {
   8:         ...
   9:     try {
  10:         name  = new String(content.substring(0, i).trim());
  11:     }
  12:         ...
  13:     catch(IndexOutOfBoundsException ex) {
  14:         name  = new String(content);

View Full Code Here
   1: 
   2:    private String fieldDelimiter;
   3: 
   4:         ...
   5: 
   6:    private String textDelimiter;
   7: 
   8:         ...
   9: 
  10:    private String fieldRegEx;
  11:    private static String fieldRegExStart = new String("([^");
  12:         ...
  13:       fieldDelimiter = new String(fldDelim);
  14:       fieldRegEx = new String(fieldRegExStart + fieldDelimiter.substring(0,1) +

View Full Code Here
   1:     
   2:     protected static String front( String s )
   3:         ...
   4:         { return s.substring( 0, s.length() - 1 ); }
   5: 
   6:         ...
   7:         {
   8:         public DyadicLiteral( Expression L, String F, String R )
   9:             { super( L, F, new Expression.Fixed( R ) ); }
  10:         ...
  11:         String s = pattern.getPatternString();
  12:         return s.endsWith( "$" ) && notSpecial( s.substring( 0, s.length() - 1 ) );

View Full Code Here
   1: 
   2:     public boolean isValid(String card) {
   3:         if ((card == null) || (card.length() < 13) || (card.length() > 19)) {
   4:         ...
   5: 
   6:     protected boolean luhnCheck(String cardNumber) {
   7:         int digits = cardNumber.length();
   8:         ...
   9:         
  10:         boolean matches(String card);
  11:         
  12:         ...
  13:             return (
  14:                 card.substring(0, 1).equals(PREFIX)

View Full Code Here

toCharArray

public char[] toCharArray()
Converts this string to a new character array.
Returns:
a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
Usages and Demos :

View More Examples of toCharArray()
   1: {
   2:     static public void main (String[] ignored) throws Throwable
   3:     {
   4:         ...
   5:     StringBuffer b = new StringBuffer ("Good string.  More than 16 chars.");
   6: 
   7:         ...
   8:     String s = b.toString();
   9: 
  10:         ...
  11:     String t = new String (s.toCharArray());

View Full Code Here
   1:     private static Class[] _serializableClasses = new Class[]
   2:     { String.class, char.class, Character.class,
   3:       byte[].class, char[].class };
   4:         ...
   5:     private static Class[] _JSONClasses = new Class[]
   6:     { String.class, Integer.class };
   7: 
   8:         ...
   9:     {
  10:         String val = jso instanceof String?(String)jso:jso.toString();
  11:     if(clazz == char.class) {
  12:         ...
  13:     } else if (clazz == char[].class) {
  14:         return val.toCharArray();        

View Full Code Here
   1: 
   2:         String password1 = "success";
   3:         ...
   4:         String md5FromPassword1ShouldBe="260ca9dd8a4577fc00b7bd5810298076";
   5:         try {
   6:         ...
   7: 
   8:             new String(CryptUtils.cryptPassword(password1.toCharArray()));
   9:             assertEquals(password1,password1);
  10:         ...
  11:             CryptUtils.setDigestAlgorithm("MD5");
  12:             String result1 = new String(CryptUtils.cryptPassword(password1.toCharArray()));

View Full Code Here
   1: 
   2:     public static char[] toChar(String string)
   3:     {
   4:         ...
   5:         if (string == null)
   6:         {
   7:         ...
   8: 
   9:         return string.toCharArray();
  10:     }

View Full Code Here
   1: 
   2: public static String encode (String s) {
   3:         ...
   4:    return new String(encode(s.getBytes())); }
   5: 
   6:         ...
   7: public static String decode (String s) {
   8:    return new String(decode(s.toCharArray())); }

View Full Code Here

toLowerCase

public String toLowerCase()
Converts all of the characters in this String to lower case using the rules of the default locale. This is equivalent to calling toLowerCase(Locale.getDefault()).

Returns:
the String, converted to lowercase.
Usages and Demos :

View More Examples of toLowerCase()
   1:   public int compare(Object o1, Object o2) {
   2:     String s1 = (String)o1;
   3:         ...
   4:     String s2 = (String)o2;
   5:         ...
   6:     return s1.toLowerCase().compareTo(
   7:         ...
   8:       s2.toLowerCase());

View Full Code Here
   1: public class FunctionDeclarationNameFilter implements IPredicateFunction {
   2:     String _filterString;
   3: 
   4:         ...
   5:     public FunctionDeclarationNameFilter(String filterString) {
   6:         _filterString = filterString;
   7:         ...
   8:             Assert.assertNotNull(obj+" has no shortDescription", ((IFunctionDeclaration)obj).getShortDescription());
   9:             return ((IFunctionDeclaration)obj).getShortDescription().toLowerCase().startsWith(
  10:         ...
  11:                 _filterString.toLowerCase());

View Full Code Here
   1: 
   2:     public FileExportJPG(GPGraphpad graphpad, String fileType) {
   3:         super(graphpad);
   4:         ...
   5:         try {
   6:             String file =
   7:                 saveDialog(
   8:         ...
   9:                     Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                     fileType.toLowerCase(),
  11:                     fileType.toUpperCase()+" Image");
  12:         ...
  13:                 BufferedImage img = getCurrentGraph().getImage(getCurrentGraph().getBackground(), 5);
  14:                 ImageIO.write(img, fileType.toLowerCase(), new File(file));

View Full Code Here
   1:   
   2:   public FileExportJPG(GPGraphpad graphpad, String fileType) {
   3:     super(graphpad);
   4:         ...
   5:     try {
   6:       String file =
   7:         saveDialog(
   8:         ...
   9:                    Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                    fileType.toLowerCase(),
  11:                    fileType.toUpperCase()+" Image");
  12:         ...
  13:         BufferedImage img = GPConverter.toImage(getCurrentGraph());
  14:         ImageIO.write(img, fileType.toLowerCase(), new File(file));

View Full Code Here
   1: 
   2:     public FileExportGIF(GPGraphpad graphpad, String fileType) {
   3:         super(graphpad);
   4:         ...
   5:         try {
   6:             String file =
   7:                 saveDialog(
   8:         ...
   9:                     Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                     fileType.toLowerCase(),
  11:                     fileType.toUpperCase()+" Image");

View Full Code Here

toLowerCase

public String toLowerCase(Locale locale)
Converts all of the characters in this String to lower case using the rules of the given Locale. Case mapping is based on the Unicode Standard version specified by the Character class. Since case mappings are not always 1:1 char mappings, the resulting String may be a different length than the original String.

Examples of lowercase mappings are in the following table:

Language Code of LocaleUpper CaseLower CaseDescription
tr (Turkish)\u0130\u0069capital letter I with dot above -> small letter i
tr (Turkish)\u0049\u0131capital letter I -> small letter dotless i
(all)French Friesfrench frieslowercased all chars in String
(all)capiotacapchicapthetacapupsilcapsigmaiotachithetaupsilonsigmalowercased all chars in String
Parameters:
locale - use the case transformation rules for this locale
Returns:
the String, converted to lowercase.
Since:
1.1
Usages and Demos :

View More Examples of toLowerCase(Locale locale)
   1:     
   2:     private final String uuid;
   3:     
   4:         ...
   5:     
   6:     public UUID(String uuid) {
   7:         ...
   8:         this.uuid = uuid.toLowerCase(Locale.US);
   9:         if(uuid.length() != 36)
  10:         ...
  11:     
  12:     private static String genString(byte[] info) {

View Full Code Here
   1:     {
   2:         public String setCase(String word)
   3:         {
   4:         ...
   5:             return word.toLowerCase(Locale.getDefault());
   6:         }
   7:         ...
   8:     {
   9:         public String setCase(String word)
  10:         {
  11:         ...
  12: 
  13:         return Character.toUpperCase(word.charAt(0)) + word.substring(1).toLowerCase(Locale.getDefault());

View Full Code Here
   1:     private NestedSequential nestedSequential;
   2:     private String     name;
   3:     private boolean    backTrace = true;
   4:         ...
   5:     private Map        elements   = new HashMap();
   6:     private String     textName   = null;
   7:     private Text       text       = null;
   8:         ...
   9: 
  10:      public void setName(String name) {
  11:         this.name = name;
  12:         ...
  13:             }
  14:             this.name = name.toLowerCase(Locale.US);

View Full Code Here
   1:     }
   2:     public static String center(String s, int len) {
   3:         return center(s, len, ' ');
   4:         ...
   5:     }
   6:     public static String center(String s, int len, char pad) {
   7:         int start;
   8:         ...
   9:             return Character.toUpperCase(c1) == Character.toUpperCase(c2)
  10:                 || Character.toLowerCase(c1) == Character.toLowerCase(c2);
  11:         } else {
  12:         ...
  13:     public static String toLowerCase(String s, Locale locale) {
  14:         return s.toLowerCase(locale);

View Full Code Here

toString

public String toString()
This object (which is already a string!) is itself returned.
Specified by:
toString in interface CharSequence
Overrides:
toString in interface Object
Returns:
the string itself.
Usages and Demos :

View More Examples of toString()
   1: 
   2:     public String unary_op = "";
   3:     public PrimaryExpr primary_expr;
   4:         ...
   5: 
   6:     public void setPackage( String s )
   7:     {
   8:         ...
   9:         if( pack_name.length() > 0 )
  10:             pack_name = new String( s + "." + pack_name );
  11:         else
  12:         ...
  13:     {
  14:         return unary_op.toString() + primary_expr.toString();

View Full Code Here
   1: 
   2:     public String getTruncatableId()
   3:     {
   4:         ...
   5: 
   6:     public void setPackage( String s )
   7:     {
   8:         ...
   9:         if( pack_name.length() > 0 )
  10:             pack_name = new String( s + "." + pack_name );
  11:         else
  12:         ...
  13:                 parser.error( "truncatable base value " +
  14:                               s.toString() + " must not be abstract", token );

View Full Code Here
   1: 
   2:     private String name;
   3: 
   4:         ...
   5: 
   6:     public Domain(String domainName){
   7:         super();
   8:         ...
   9:     }
  10:     public Domain(String domainName,PermissionCollection pcoll){
  11:         name = domainName;
  12:         ...
  13:     public int hashCode() {
  14:         return name.toString().hashCode();

View Full Code Here
   1: 
   2:    private void printIndent(String s)
   3:    {
   4:         ...
   5:          Object obj = o.getOption(key);
   6:          System.out.println(obj.toString() + "\n");
   7:       }
   8:         ...
   9:       Class c1 = o.getClass();
  10:       String c1name = c1.getName();
  11:         ...
  12:       String shortname = c1name.substring(c1name.lastIndexOf('.') + 1);

View Full Code Here
   1: 
   2:   private String name;
   3: 
   4:         ...
   5:   public SimpleName(String name) {
   6:     this.name = name;
   7:         ...
   8:     if (o.size() > 1) return false;
   9:     return name.toString().endsWith(o.toString());
  10:   }
  11:         ...
  12:     if (o.size() > 1) return false;
  13:     return name.toString().startsWith(o.toString());

View Full Code Here

toUpperCase

public String toUpperCase()
Converts all of the characters in this String to upper case using the rules of the default locale. This method is equivalent to toUpperCase(Locale.getDefault()).

Returns:
the String, converted to uppercase.
Usages and Demos :

View More Examples of toUpperCase()
   1: 
   2:     public static Severity fromString(String fieldName) {
   3:         ...
   4:         return fieldName != null ? Severity.valueOf(fieldName.toUpperCase())
   5:                 : NONE;
   6:         ...
   7: 
   8:     public String toString() {
   9:         return super.toString().toLowerCase();

View Full Code Here
   1: 
   2:     public FileExportJPG(GPGraphpad graphpad, String fileType) {
   3:         super(graphpad);
   4:         ...
   5:         try {
   6:             String file =
   7:                 saveDialog(
   8:         ...
   9:                     Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                     fileType.toLowerCase(),
  11:         ...
  12:                     fileType.toUpperCase()+" Image");

View Full Code Here
   1:   
   2:   public FileExportJPG(GPGraphpad graphpad, String fileType) {
   3:     super(graphpad);
   4:         ...
   5:     try {
   6:       String file =
   7:         saveDialog(
   8:         ...
   9:                    Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                    fileType.toLowerCase(),
  11:         ...
  12:                    fileType.toUpperCase()+" Image");

View Full Code Here
   1: 
   2:     public FileExportGIF(GPGraphpad graphpad, String fileType) {
   3:         super(graphpad);
   4:         ...
   5:         try {
   6:             String file =
   7:                 saveDialog(
   8:         ...
   9:                     Translator.getString("FileSaveAsLabel") + " "+fileType.toUpperCase(),
  10:                     fileType.toLowerCase(),
  11:         ...
  12:                     fileType.toUpperCase()+" Image");

View Full Code Here
   1:     
   2:     public JdbcTableInfo getTableInfo(String name)
   3:     {
   4:         ...
   5:         return name != null ? (JdbcTableInfo)_tables.get(name.toUpperCase()) : null;
   6:     }
   7:         ...
   8:         try {
   9:             String[] types = {"TABLE"};
  10:             
  11:         ...
  12:     {
  13:         String name = rs.getString("TABLE_NAME");

View Full Code Here

toUpperCase

public String toUpperCase(Locale locale)
Converts all of the characters in this String to upper case using the rules of the given Locale. Case mapping is based on the Unicode Standard version specified by the Character class. Since case mappings are not always 1:1 char mappings, the resulting String may be a different length than the original String.

Examples of locale-sensitive and 1:M case mappings are in the following table.

Language Code of LocaleLower CaseUpper CaseDescription
tr (Turkish)\u0069\u0130small letter i -> capital letter I with dot above
tr (Turkish)\u0131\u0049small letter dotless i -> capital letter I
(all)\u00df\u0053 \u0053small letter sharp s -> two letters: SS
(all)FahrvergnügenFAHRVERGNÜGEN
Parameters:
locale - use the case transformation rules for this locale
Returns:
the String, converted to uppercase.
Since:
1.1
Usages and Demos :

View More Examples of toUpperCase(Locale locale)
   1: 
   2:     private final String expression;
   3: 
   4:         ...
   5: 
   6:     public CronExpression(String expression) {
   7:         this(expression, Locale.US);
   8:         ...
   9: 
  10:     private CronExpression(String expression, Locale locale) {
  11:         if (expression == null) {
  12:         ...
  13: 
  14:         this.expression = expression.toUpperCase(Locale.US);

View Full Code Here
   1:     {
   2:         public String setCase(String word)
   3:         {
   4:         ...
   5:     {
   6:         public String setCase(String word)
   7:         {
   8:         ...
   9:         {
  10:             return word.toUpperCase(Locale.getDefault());
  11:         }
  12:         ...
  13: 
  14:         return Character.toUpperCase(word.charAt(0)) + word.substring(1).toLowerCase(Locale.getDefault());

View Full Code Here
   1:     
   2:     private final static Map<String, String> lc2cc;
   3:     
   4:         ...
   5:     static {
   6:         lc2cc = new HashMap<String, String>();
   7:         lc2cc.put("en","US");
   8:         ...
   9:     
  10:     public static ImageIcon getFlag(String countryCode, String languageCode) {
  11:         return getFlag(countryCode, languageCode, false);
  12:         ...
  13:             try {
  14:                 flag = GUIMediator.getThemeImage("flags/" + countryCode.toUpperCase(Locale.US));

View Full Code Here
   1: 
   2:     public HTMLElementImpl( HTMLDocumentImpl owner, String tagName ) {
   3:         ...
   4:         super( owner, tagName.toUpperCase(Locale.ENGLISH) );
   5:     }
   6:         ...
   7:     
   8:     public String getId() {
   9:         return getAttribute( "id" );
  10:         ...
  11:     
  12:     public void setId( String id ) {

View Full Code Here
   1:     
   2:     protected Map<String,String> servers;
   3:     
   4:         ...
   5:     protected String name;
   6:     
   7:         ...
   8:     protected Map<String,String> values;
   9:     
  10:         ...
  11:                     if (-1 != (index = line.indexOf(":"))) {
  12:                         this.setValue(name.toUpperCase(Locale.ENGLISH), value.toString());

View Full Code Here

trim

public String trim()
Returns a copy of the string, with leading and trailing whitespace omitted.

If this String object represents an empty character sequence, or the first and last characters of character sequence represented by this String object both have codes greater than '\u0020' (the space character), then a reference to this String object is returned.

Otherwise, if there is no character with a code greater than '\u0020' in the string, then a new String object representing an empty string is created and returned.

Otherwise, let k be the index of the first character in the string whose code is greater than '\u0020', and let m be the index of the last character in the string whose code is greater than '\u0020'. A new String object is created, representing the substring of this string that begins with the character at index k and ends with the character at index m-that is, the result of this.substring(km+1).

This method may be used to trim whitespace (as defined above) from the beginning and end of a string.

Returns:
A copy of this string with leading and trailing white space removed, or this string if it has no leading or trailing white space.
Usages and Demos :

View More Examples of trim()
   1: 
   2:   public String getCategoryId() { return categoryId; }
   3:         ...
   4:   public void setCategoryId(String categoryId) { this.categoryId = categoryId.trim(); }
   5: 
   6:         ...
   7:   public String getName() { return name; }
   8:   public void setName(String name) { this.name = name; }

View Full Code Here
   1: 
   2:   public String getProductId() { return productId; }
   3:         ...
   4:   public void setProductId(String productId) { this.productId = productId.trim(); }
   5: 
   6:         ...
   7:   public String getCategoryId() { return categoryId; }
   8:   public void setCategoryId(String categoryId) { this.categoryId = categoryId; }

View Full Code Here
   1: 
   2:   public String getItemId() { return itemId; }
   3:         ...
   4:   public void setItemId(String itemId) { this.itemId = itemId.trim(); }
   5: 
   6:         ...
   7: 
   8:   public String getProductId() { return productId; }
   9:   public void setProductId(String productId) { this.productId = productId; }

View Full Code Here
   1: 
   2:     public Object toObject(Class type, String stringValue)
   3:     throws TypeConversionException {
   4:         ...
   5:                 Class.forName(
   6:                     stringValue.trim(),
   7:                     true,
   8:         ...
   9: 
  10:     public String toString(Object objectValue) {
  11:         return ((Class) objectValue).getName();

View Full Code Here
   1:   public void setValueAt(Object value, int row, int col) {
   2:     data[row][col] = new Expression( (String)value );
   3:     fireTableDataChanged(  );
   4:         ...
   5:   class Expression {
   6:     String text;
   7:     StringTokenizer tokens;
   8:         ...
   9:     String token;
  10: 
  11:         ...
  12:     Expression( String text ) { this.text = text.trim(  ); }

View Full Code Here

valueOf

public static String valueOf(boolean b)
Returns the string representation of the boolean argument.
Parameters:
b - a boolean.
Returns:
if the argument is true, a string equal to "true" is returned; otherwise, a string equal to "false" is returned.
Usages and Demos :

View More Examples of valueOf(boolean b)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(char c)
Returns the string representation of the char argument.
Parameters:
c - a char.
Returns:
a string of length 1 containing as its single character the argument c.
Usages and Demos :

View More Examples of valueOf(char c)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(data[] )
Returns the string representation of the char array argument. The contents of the character array are copied; subsequent modification of the character array does not affect the newly created string.
Parameters:
Returns:
a newly allocated string representing the same sequence of characters contained in the character array argument.
Usages and Demos :

View More Examples of valueOf(data[] )
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(data[] ,
                             int offset,
                             int count)
Returns the string representation of a specific subarray of the char array argument.

The offset argument is the index of the first character of the subarray. The count argument specifies the length of the subarray. The contents of the subarray are copied; subsequent modification of the character array does not affect the newly created string.

Parameters:
offset - the initial offset into the value of the String.
count - the length of the value of the String.
Returns:
a string representing the sequence of characters contained in the subarray of the character array argument.
Throws:
IndexOutOfBoundsException - if offset is negative, or count is negative, or offset+count is larger than data.length.
Usages and Demos :

View More Examples of valueOf(data[] ,int offset,int count)
   1: {
   2:     private static final String TAG_MESSAGE = "log4j:message";
   3:         ...
   4:     private static final String TAG_THROWABLE = "log4j:throwable";
   5:     private final MyTableModel mModel;
   6:         ...
   7:     private long mTimeStamp;
   8:     private String mCategoryName;
   9:     private String mThreadName;
  10:         ...
  11:     public void characters(char[] aChars, int aStart, int aLength) {
  12:         mBuf.append(String.valueOf(aChars, aStart, aLength));

View Full Code Here
   1: 
   2:     public DynamicCharacterArray(String str) {
   3:         this(str.toCharArray());
   4:         ...
   5:    
   6:     public int insert(int position, String str) {
   7:         return insert(str.toCharArray(), 0, str.length(), position);
   8:         ...
   9: 
  10:     public String toString() {
  11:         ...
  12:         return String.valueOf(buffer, 0, length);

View Full Code Here
   1: class Tokenstring extends MOFToken {
   2:     String value;
   3:     
   4:         ...
   5:     public String tokenString() throws
   6:         IllegalArgumentException {
   7:         ...
   8:     
   9:     public String tokenName() {
  10:     return("tokenval="+value);
  11:         ...
  12:          return(new Tokennumber(MOFToken.DECIMAL_VALUE,
  13:             String.valueOf(inarray,toffset,offset-toffset)));

View Full Code Here
   1: public class LongString {
   2:     public static String copyValueOf(char[] data) {
   3:         ...
   4:         return String.copyValueOf(data);
   5:     }
   6:         ...
   7: 
   8:     public static String copyValueOf(char[] data, int offset, int count) {
   9:         return String.copyValueOf(data, offset, count);
  10:         ...
  11:     public static String valueOf(char[] data, int offset, int count) {
  12:         return String.valueOf(data, offset, count);

View Full Code Here
   1: 
   2:     public final static String[] splitString(String val) {
   3:         return splitString(val,"\n\r\t", -1);
   4:         ...
   5:         
   6:     public final static String[] splitString(String val, String delims) {
   7:         return splitString(val, delims, -1); 
   8:         ...
   9:         }
  10:         return String.valueOf(res, 0, didx);
  11:     }
  12:         ...
  13:             }
  14:         return String.valueOf(buf, 0, buflen);

View Full Code Here

valueOf

public static String valueOf(double d)
Returns the string representation of the double argument.

The representation is exactly the one returned by the Double.toString method of one argument.

Parameters:
d - a double.
Returns:
a string representation of the double argument.
Usages and Demos :

View More Examples of valueOf(double d)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(float f)
Returns the string representation of the float argument.

The representation is exactly the one returned by the Float.toString method of one argument.

Parameters:
f - a float.
Returns:
a string representation of the float argument.
Usages and Demos :

View More Examples of valueOf(float f)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(int i)
Returns the string representation of the int argument.

The representation is exactly the one returned by the Integer.toString method of one argument.

Parameters:
i - an int.
Returns:
a string representation of the int argument.
Usages and Demos :

View More Examples of valueOf(int i)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(Object obj)
Returns the string representation of the Object argument.
Parameters:
obj - an Object.
Returns:
if the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned.
Usages and Demos :

View More Examples of valueOf(Object obj)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

valueOf

public static String valueOf(long l)
Returns the string representation of the long argument.

The representation is exactly the one returned by the Long.toString method of one argument.

Parameters:
l - a long.
Returns:
a string representation of the long argument.
Usages and Demos :

View More Examples of valueOf(long l)
   1: 
   2:     public MessageFormat findFormat(String _key) {
   3:         throw new UnsupportedOperationException();
   4:         ...
   5: 
   6:     public String findPattern(String _key) {
   7:         throw new UnsupportedOperationException();
   8:         ...
   9:             Object _arg4) {
  10:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3) + ", " + String.valueOf(_arg4);
  11:     }
  12:         ...
  13:     public String format(String _key, Object _arg1, Object _arg2, Object _arg3) {
  14:         return _key + ", " + String.valueOf(_arg1) + ", " + String.valueOf(_arg2) + ", " + String.valueOf(_arg3);

View Full Code Here
   1: 
   2:     private String serialization = null;
   3: 
   4:         ...
   5:     private String jtype = null;
   6: 
   7:         ...
   8: 
   9:     public String getName()
  10:     {
  11:         ...
  12:         jtype = className;
  13:         serialization = new String("CCAFE."+String.valueOf(serialNumber));

View Full Code Here
   1:         
   2:         if ( object instanceof String || object instanceof Float){
   3:             
   4:         ...
   5:             String tempString = (object instanceof String) ? (String)object : String.valueOf((Float)object);
   6: 
   7:         ...
   8:             
   9:             write(baos,Constants.DEFAULT_CHARSET.encode(String.valueOf(bb.limit())));
  10:             
  11:         ...
  12:                         
  13:                         String    key = (String)o_key;

View Full Code Here
   1:     MyNode root;
   2:     String predBlock;
   3:         ...
   4:     String constructBlock;
   5:         ...
   6:     String inWhichElement;
   7:     int blockIndent;
   8:         ...
   9:         count++;
  10:         return new String("$v"+ String.valueOf(count));

View Full Code Here
   1:     
   2:     String query;
   3:     int indent;
   4:         ...
   5:     {
   6:     query=new String();
   7:     indent=0;
   8:         ...
   9: 
  10:     public static String genIndent(int size)
  11:     {
  12:         ...
  13:         count++;
  14:         return new String("$v"+ String.valueOf(count));

View Full Code Here

void getBytes

public @Deprecated void getBytes(int srcBegin,
                                 int srcEnd,
                                 dst[] ,
                                 int dstBegin)

Deprecated. This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the getBytes() method, which uses the platform's default charset.

Copies characters from this string into the destination byte array. Each byte receives the 8 low-order bits of the corresponding character. The eight high-order bits of each character are not copied and do not participate in the transfer in any way.

The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1. The total number of characters to be copied is srcEnd-srcBegin. The characters, converted to bytes, are copied into the subarray of dst starting at index dstBegin and ending at index:

     dstbegin + (srcEnd-srcBegin) - 1
 
Parameters:
srcBegin - index of the first character in the string to copy.
srcEnd - index after the last character in the string to copy.
dstBegin - the start offset in the destination array.
Throws:
IndexOutOfBoundsException - if any of the following is true:
  • srcBegin is negative
  • srcBegin is greater than srcEnd
  • srcEnd is greater than the length of this String
  • dstBegin is negative
  • dstBegin+(srcEnd-srcBegin) is larger than dst.length