String functions

# Name Description Complexity
1 drop(String, Int): String Drops the first n characters of a string 1
2 dropRight(String, Int): String Drops the last n characters of a string 19
3 indexOf(String, String): Int|Unit Returns the index of the first occurrence of a substring 20
4 indexOf(String, String, Int): Int|Unit Returns the index of the first occurrence of a substring after a certain index 20
5 size(String): Int Returns the size of a string 1
6 split(String, String): List[String] Splits a string delimited by a separator into a list of substrings 100
7 take(String, Int): String Takes the first n characters from a string 1
8 takeRight(String, Int): String Takes the last n characters from a string 19

drop(String, Int): Str

Drops the first n characters of a string.

drop(xs: String, number: Int): String

Parameters

xs: String

The string.

number: Int

The number n.

dropRight(String, Int): String

Drops the last n characters of a string.

dropRight(xs: String, number: Int): String

Parameters

xs: String

The string.

number: Int

The number n.

indexOf(String, String): Int|Unit

Returns the index of the first occurrence of a substring.

indexOf(str: String, substr: String): Int|Unit

Parameters

str: String

The string.

substr: String

The substring.

indexOf(String, String, Int): Int|Unit

Returns the index of the first occurrence of a substring after a certain index.

indexOf(str: String, substr: String, offset: Int): Int|Unit

Parameters

str: String

The string.

substr: String

The substring.

offset: Int

The index.

size(String): Int

Returns the size of a string.

size(xs: String): Int

Parameters

xs: String

The string.

split(String, String): List[String]

Splits a string delimited by a separator into a list of substrings.

split(str: String, separator: String): List[String]

Parameters

str: String

The string.

separator: Int

The separator.

take(String, Int): String

Takes the first n characters from a string.

take(xs: String, number: Int): String

Parameters

xs: String

The string.

number: Int

The number n.

takeRight(String, Int): String

Takes the last n characters from a string.

takeRight(xs: String, number: Int): String

Parameters

xs: String

The string.

number: Int

The number n.

results matching ""

    No results matching ""