StringContext

Companion
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

An exception that is thrown if a string contains a backslash (\) character that does not start a valid escape sequence.

An exception that is thrown if a string contains a backslash (\) character that does not start a valid escape sequence.

Value Params
index

The index of the offending backslash character in str.

str

The offending string

Inherited types

The names of the product elements

The names of the product elements

Inherited from
Mirror

The name of the type

The name of the type

Inherited from
Mirror

Value members

Concrete methods

def checkLengths(args: Seq[Any], parts: Seq[String]): Unit

Checks that the length of the given argument args is one less than the number of parts supplied to the StringContext.

Checks that the length of the given argument args is one less than the number of parts supplied to the StringContext.

Throws
IllegalArgumentException

if this is not the case.

def glob(patternChunks: Seq[String], input: String): Option[Seq[String]]

Linear time glob-matching implementation.

Linear time glob-matching implementation. Adapted from https://research.swtch.com/glob

Value Params
input

The input you wish to match against

patternChunks

The non-wildcard portions of the input pattern, separated by wildcards

Returns

None if there is no match, Some containing the sequence of matched wildcard strings if there is a match

Expands standard Scala escape sequences in a string.

Expands standard Scala escape sequences in a string. Escape sequences are: control: \b, \t, \n, \f, \r escape: \\, \", \'

Value Params
str

A string that may contain escape sequences

Returns

The string with all escape sequences expanded.

def standardInterpolator(process: String => String, args: Seq[Any], parts: Seq[String]): String

Deprecated methods

@deprecated("use processEscapes", "2.13.0")

Expands standard Scala escape sequences in a string.

Expands standard Scala escape sequences in a string. Escape sequences are: control: \b, \t, \n, \f, \r escape: \\, \", \'

Value Params
str

A string that may contain escape sequences

Returns

The string with all escape sequences expanded.

Deprecated