net.liftweb.util.StringHelpers

object StringHelpers

object StringHelpers

 extends StringHelpers




Companion: StringHelpers

Source: StringHelpers.scala(26)

 Constructors

def this

 Methods

!=.. final def !=(arg0 : Object) Boolean AnyRef
!=.. final def !=(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Object) Boolean AnyRef
asInstanceOf.. final def asInstanceOf[T0] T0 Any
camelify.. def camelify(name : String)
Turns a string of format "foo_bar" into camel case "FooBar" Functional code courtesy of Jamie Webb (j@jmawebb [details]
cjb.net) 2006/11/28
param
name - the String to CamelCase
return
- the CamelCased string
String StringHelpers
camelifyMethod.. def camelifyMethod(name : String)
Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names [details]
param
name - the String to CamelCase
return
- the CamelCased string
String StringHelpers
capify.. def capify(in : String)
Capitalize every "word" in the string [details]
A word is either separated by spaces or underscores.
param
in - string to capify
return
- the capified string
String StringHelpers
clean.. def clean(in : String)
Remove all the characters from a string exception a-z, A-Z, 0-9, and '_' [details]
return
- the cleaned string and an empty string if the input is null
String StringHelpers
clone.. protected def clone Object AnyRef
emptyForNull.. def emptyForNull(s : String)
Test for null and return either the given String if not null or the empty String
String StringHelpers
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
escChar.. def escChar(in : Char)
Create the unicode value of a character [details]
param
in - character
return
- the unicode value as a string starting by \\u
String StringHelpers
finalize.. protected def finalize Unit AnyRef
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
ne.. final def ne(arg0 : Object) Boolean AnyRef
nodeSeqToOptionString.. implicit def nodeSeqToOptionString(in : NodeSeq)
[details]
return
- an Empty can if the node seq is empty and a full can with the NodeSeq text otherwise
Box[String] StringHelpers
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
parseNumber.. def parseNumber(tin : String)
Parse a string and return the Long value of that string [details]

The string can start with '-' if it is a negative number or '+' for a positive number

return
- the Long value of the input String
Long StringHelpers
processString.. def processString(msg : String, subst : Map[String, String])
Replaces the value found in a string surrounded by <%= [details]
.. %> by a replacement according to the value found in the subst Map.

Throws an exception if no correspondance can be found.

param
subst - map of [regular expression with groups, replacement]
msg - string where replacements should be done
String StringHelpers
randomString.. def randomString(size : Int)
Create a random string of a given size [details]
param
size - size of the string to create. Must be a positive or nul integer
return
- the generated string
String StringHelpers
snakify.. def snakify(name : String)
Turn a string of format "FooBar" into snake case "foo_bar" Note: snakify is not reversible, ie [details]
in general the following will _not_ be true: s == camelify(snakify(s))
return
- the underscored string
String StringHelpers
splitColonPair.. def splitColonPair(in : String, first : String, second : String)
Split a string separated by a point or by a column in 2 parts [details]
Uses default values if only one is found or if no parts are found
param
first - default value for the first part if no split can be done
second - default value for the second part if one or less parts can be found
in - string to split
return
- a pair containing the first and second parts
(String, String) StringHelpers
splitNameValuePairs.. def splitNameValuePairs(props : String)
Splits a string of the form <name1=value1, name2=value2, [details]
.. > and unquotes the quoted values. The result is a Map[String, String]
Map[String, String] StringHelpers
stringToSuper.. implicit def stringToSuper(in : String)
[details]
return
- a SuperString with more available methods such as roboSplit or commafy
SuperString StringHelpers
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
unquote.. def unquote(str : String)
If str is surrounded by quotes it return the content between the quotes
String StringHelpers
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.