mirror of
https://github.com/sbt/sbt.git
synced 2026-08-29 01:24:09 +02:00
15 lines
335 B
Scala
15 lines
335 B
Scala
/* sbt -- Simple Build Tool
|
|||
|
|
* Copyright 2009 Mark Harrah
|
||
|
|
*/
|
||
|
|
package sbt
|
||
|
|
|
||
|
|
object StringUtilities
|
||
|
|
{
|
||
|
|
def normalize(s: String) = s.toLowerCase.replaceAll("""\s+""", "-")
|
||
|
|
def nonEmpty(s: String, label: String)
|
||
|
|
{
|
||
|
|
require(s.trim.length > 0, label + " cannot be empty.")
|
||
|
|
}
|
||
|
|
def appendable(s: String) = if(s.isEmpty) "" else "_" + s
|
||
|
|
}
|