StringIndexExtension

weaponregex.extension.StringExtension$.StringIndexExtension
implicit class StringIndexExtension(string: String)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

final def locationOf(start: Int, end: Int): Location

Convert a pair of start and end indices into a weaponregex.model.Location in the given string.

Convert a pair of start and end indices into a weaponregex.model.Location in the given string.

Attributes

end

End index

start

Start index

Returns:

A weaponregex.model.Location

final def positionOf(index: Int): Position

Convert an index into a weaponregex.model.Position in the given string.

Convert an index into a weaponregex.model.Position in the given string.

Attributes

index

An index

Returns:

A weaponregex.model.Position

final def toLineCol(index: Int): (Int, Int)

Convert an index of into row and column numbers in the given string.

Convert an index of into row and column numbers in the given string.

Attributes

index

An index

Returns:

A tuple of row and column numbers

Note:

This function implementation is taken from here