StringIndexExtension

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

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

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.

Value parameters

end

End index

start

Start index

Attributes

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.

Value parameters

index

An index

Attributes

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.

Value parameters

index

An index

Attributes

Returns

A tuple of row and column numbers

Note

This function implementation is taken from here