scalax.data

object StringHelp

[source: scalax/data/StringHelp.scala]

object StringHelp
extends AnyRef
Some convenience functions for string manipulation.
Method Summary
def cEscape (x : java.lang.String) : java.lang.String
Backslash-escapes a string
def pad (s : java.lang.String, l : Int, c : Char) : java.lang.String
Pads the string up to the given length using the given character.
def toBoolean (s : java.lang.String) : Boolean
Gets the truth value of a string.
def truncate (s : java.lang.String, maxLen : Int, terminator : java.lang.String) : java.lang.String
Truncates a string, and adds a terminator afterwards. Attempts to stop at whitespace if there's some within 10 characters of the maximum length.
def uncapitalize (s : java.lang.String) : java.lang.String
Uncapitalizes the first letter of a string
def xmlEscape (x : java.lang.String) : java.lang.String
XML-escapes a string.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def xmlEscape(x : java.lang.String) : java.lang.String
XML-escapes a string.

def cEscape(x : java.lang.String) : java.lang.String
Backslash-escapes a string

def truncate(s : java.lang.String, maxLen : Int, terminator : java.lang.String) : java.lang.String
Truncates a string, and adds a terminator afterwards. Attempts to stop at whitespace if there's some within 10 characters of the maximum length.

def uncapitalize(s : java.lang.String) : java.lang.String
Uncapitalizes the first letter of a string

def toBoolean(s : java.lang.String) : Boolean
Gets the truth value of a string.

def pad(s : java.lang.String, l : Int, c : Char) : java.lang.String
Pads the string up to the given length using the given character.


Copyright (c) 2005-8 The Scalax Project. All Rights Reserved.