implicit final class StringOps extends AnyVal
- Alphabetic
- By Inheritance
- StringOps
- AnyVal
- Any
- by AnyOps
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StringOps(value: String)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
- def +(other: String): String
- def ->[B](y: B): (StringOps, B)
-
def
/(pathname: String): File
Creates a new
File
instance from this value and a child pathname string.Creates a new
File
instance from this value and a child pathname string.- pathname
the child pathname, either a directory or a file
- returns
the new
File
instance from this input text and a child pathname string
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
asBoolean: Option[Boolean]
Typesafe alternative to
toBoolean
.Typesafe alternative to
toBoolean
.- returns
if the input text is parseable as boolean, an option containing it;
None
otherwise
-
def
asByte: Option[Byte]
Typesafe alternative to
toByte
.Typesafe alternative to
toByte
.- returns
if the input text is parseable as byte, an option containing it;
None
otherwise
-
def
asDouble: Option[Double]
Typesafe alternative to
toDouble
.Typesafe alternative to
toDouble
.- returns
if the input text is parseable as double, an option containing it;
None
otherwise
-
def
asFloat: Option[Float]
Typesafe alternative to
toFloat
.Typesafe alternative to
toFloat
.- returns
if the input text is parseable as float, an option containing it;
None
otherwise
-
def
asInputStream: InputStream
Creates a
InputStream
backed by this input text using the UTF-8 charset.Creates a
InputStream
backed by this input text using the UTF-8 charset.- returns
the
InputStream
backed by this input text
- Annotations
- @inline()
-
def
asInputStream(cs: Charset = utf8): InputStream
Creates a
InputStream
backed by this input text.Creates a
InputStream
backed by this input text.- cs
the
Charset
to be used to encode the input text- returns
the
InputStream
backed by this input text
- Annotations
- @inline()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asInt: Option[Int]
Typesafe alternative to
toInt
.Typesafe alternative to
toInt
.- returns
if the input text is parseable as int, an option containing it;
None
otherwise
-
def
asLong: Option[Long]
Typesafe alternative to
toLong
.Typesafe alternative to
toLong
.- returns
if the input text is parseable as long, an option containing it;
None
otherwise
-
def
asShort: Option[Short]
Typesafe alternative to
toShort
.Typesafe alternative to
toShort
.- returns
if the input text is parseable as short, an option containing it;
None
otherwise
-
def
constantTimeEquals(that: String, cs: Charset = utf8): Boolean
Compares two strings for equality using a constant time simple byte compare.
Compares two strings for equality using a constant time simple byte compare.
- that
the string to compare to
- cs
the
CharSet
to be used for the comparison (defaults to UTF-8)- returns
true if both strings are equal, false otherwise
- Annotations
- @inline()
- def ensuring(cond: (StringOps) ⇒ Boolean, msg: ⇒ Any): StringOps
- def ensuring(cond: (StringOps) ⇒ Boolean): StringOps
- def ensuring(cond: Boolean, msg: ⇒ Any): StringOps
- def ensuring(cond: Boolean): StringOps
- def formatted(fmtstr: String): String
-
def
future: Future[StringOps]
Creates an already completed
Future
containingvalue
.Creates an already completed
Future
containingvalue
.- returns
the already completed
Future
with the specified result
- Implicit
- This member is added by an implicit conversion from StringOps to AnyOps[StringOps] performed by method AnyOps in scail.commons.ops.
- Definition Classes
- AnyOps
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
def
isBlank: Boolean
Checks whether the input text is empty (
""
), null or whitespace-only.Checks whether the input text is empty (
""
), null or whitespace-only.- returns
true if the input text is null, empty or whitespace only, false otherwise
- Annotations
- @inline()
-
def
isFalsy: Boolean
Whether the input text is one of "n", "no", "f", "false", "off".
Whether the input text is one of "n", "no", "f", "false", "off". Case and leading and trailing whitespace do not matter.
- returns
true if the input text is falsy, false otherwise
- Annotations
- @inline()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTruthy: Boolean
Whether the input text is one of "y", "yes", "t", "true", "on".
Whether the input text is one of "y", "yes", "t", "true", "on". Case and leading and trailing whitespace do not matter.
- returns
true if the input text is truthy, false otherwise
- Annotations
- @inline()
-
def
nonBlank: Boolean
Checks whether the input text is not empty (
""
), not null and not whitespace-only.Checks whether the input text is not empty (
""
), not null and not whitespace-only.- returns
true if the input text is not null, empty or whitespace-only, false otherwise
- Annotations
- @inline()
-
def
normalizeSpace: String
Removes leading and trailing whitespace and replaces sequences of whitespace by a single one.
Removes leading and trailing whitespace and replaces sequences of whitespace by a single one.
- returns
the input text with leading, trailing and consecutive whitespace removed
- Annotations
- @inline()
-
def
option: Option[StringOps]
Creates an
Option
containingvalue
.Creates an
Option
containingvalue
.- returns
Some(value)
ifvalue
is notnull
,None
otherwise
- Implicit
- This member is added by an implicit conversion from StringOps to AnyOps[StringOps] performed by method AnyOps in scail.commons.ops.
- Definition Classes
- AnyOps
- Annotations
- @inline()
-
def
reader: Reader
Creates a
Reader
backed by this input text.Creates a
Reader
backed by this input text.- returns
the
Reader
backed by this input text
- Annotations
- @inline()
-
def
safeEquals(that: String, cs: Charset = utf8): Boolean
Alias for
constantTimeEquals
.Alias for
constantTimeEquals
.- Annotations
- @inline()
-
def
stripAccents: String
Removes diacritics (accents) from the input text.
Removes diacritics (accents) from the input text.
- returns
the input text with diacritics removed
- Annotations
- @inline()
-
def
tap(f: (StringOps) ⇒ Unit): StringOps
Applies side-effectul method to
value
, returningvalue
.Applies side-effectul method to
value
, returningvalue
.- f
the side-effectful method to apply to
value
- returns
value
- Implicit
- This member is added by an implicit conversion from StringOps to AnyOps[StringOps] performed by method AnyOps in scail.commons.ops.
- Definition Classes
- AnyOps
-
def
titleCase: String
Converts all the whitespace separated words into capitalized words, that is each word is made up of a title case character and then a series of lowercase characters.
Converts all the whitespace separated words into capitalized words, that is each word is made up of a title case character and then a series of lowercase characters. Capitalization uses the Unicode title case, normally equivalent to upper case.
- returns
the input text capitalized to title case
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- Any
- def →[B](y: B): (StringOps, B)