StringOps

final
class StringOps(val self: String) extends AnyVal
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def charsNel: Option[NonEmptyList[Char]]

Constructs a non-empty list with the value if it is not empty, otherwise, throws an error.

Constructs a non-empty list with the value if it is not empty, otherwise, throws an error.

def charsNel(e: => NonEmptyList[Char]): NonEmptyList[Char]

Constructs a non-empty list with the given string if it is not empty, otherwise, returns the second argument.

Constructs a non-empty list with the given string if it is not empty, otherwise, returns the second argument.

def parseBigDecimal: Validation[NumberFormatException, BigDecimal]
def parseBigInt: Validation[NumberFormatException, BigInt]
def parseBoolean: Validation[IllegalArgumentException, Boolean]
def parseByte: Validation[NumberFormatException, Byte]
def parseDouble: Validation[NumberFormatException, Double]
def parseFloat: Validation[NumberFormatException, Float]
def parseInt: Validation[NumberFormatException, Int]
def parseLong: Validation[NumberFormatException, Long]
def parseShort: Validation[NumberFormatException, Short]
def plural(n: Long): String

Returns the same String value if the given value is 1 otherwise pluralises this String by appending an "s" unless this String ends with "y" and not one of ["ay", "ey", "iy", "oy", "uy"] in which case the 'y' character is chopped and "ies" is appended.

Returns the same String value if the given value is 1 otherwise pluralises this String by appending an "s" unless this String ends with "y" and not one of ["ay", "ey", "iy", "oy", "uy"] in which case the 'y' character is chopped and "ies" is appended.

Deprecated methods

@deprecated("Unsafe. Use `charsNel` instead", "7.2")
def charsNelErr(message: => String): NonEmptyList[Char]
Deprecated
@deprecated("Unsafe. Use `charsNel` instead", "7.2")
Deprecated

Concrete fields

val self: String