_global_
Class String

java.lang.Object
  extended by _global_.String

public class String
extends java.lang.Object

A string. Notice that, in JavaScript, there is no character.

Refer to JavaScript Reference.


Method Summary
 String $camel()
          Returns a copy of this string by converting dashes into a camel-case equivalent.
 String $inc(int diff)
          Returns a copy of the first character of a string by increasing its value.
 String $sub(String cc)
          Returns the difference between the first character of this string and the first character of the specified string.
 boolean endsWith(String postfix)
          Returns whether this string ends with the specified postfix.
 boolean startsWith(String prefix)
          Returns whether this string starts with the specified prefix.
 String trim()
          Returns a copy of the string, with leading and trailing whitespace omitted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

$camel

public String $camel()
Returns a copy of this string by converting dashes into a camel-case equivalent.

Example:

"foo-bar".$camel(); //returns "fooBar"

Returns:
the cameled copy of this string.

$inc

public String $inc(int diff)
Returns a copy of the first character of a string by increasing its value.

For example, 'a'.$inc(2) is 'c' (same as 'a' + 2 in Java) and 'z'.$inc(-1) is 'y'.

Parameters:
diff - number to increase
Returns:
the increased coy of this string.
See Also:
$sub(_global_.String)

$sub

public String $sub(String cc)
Returns the difference between the first character of this string and the first character of the specified string.

For example, 'd'.$sub('c') is 1 (same as 'd' - 'c' in Java)

Parameters:
cc - a string to compare with
Returns:
the difference between this string and the specified one.
See Also:
$inc(int)

startsWith

public boolean startsWith(String prefix)
Returns whether this string starts with the specified prefix.

Parameters:
prefix - the prefix to test
See Also:
endsWith(_global_.String)

endsWith

public boolean endsWith(String postfix)
Returns whether this string ends with the specified postfix.

Parameters:
postfix - the postfix to test
See Also:
startsWith(_global_.String)

trim

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



Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo