Package-level declarations
Types
https://gist.github.com/SuppieRK/a6fb471cf600271230c8c7e532bdae4b
Supports the regex builder function.
Functions
Applies the given blocks to the receiver object.
Applies the given block to each element in the iterable and returns the receiver object.
shorthand for this as? Collection<E> ?: toList()
Replaces the deprecated Kotlin version, but hard-codes Locale.US
Creates a new file if it doesn't already exist, creating parent directories if necessary. If the file already exists, its content will be overwritten. If content is provided, it will be written to the file.
Checks if the receiver File exists and returns it, or null if it does not exist.
Filters the receiver iterable and adds the matching elements to a set.
Reads the receiver File and finds the minimum indent in its content.
Finds and returns the minimum indentation for this String, with an optional absoluteMinimum to be returned if the minimum indent is less than the absolute minimum.
Transforms each element of the receiver iterable to an iterable and flattens these iterables into a single set.
example:
A naive auto-indent which just counts brackets.
Calculates and returns the width of the indentation for this String.
shorthand for joinToString("") { ... }
Adjusts the indentation of each line in the string to match the indentation of the first non-blank line. The first non-blank line determines the target indentation level, and subsequent lines are adjusted accordingly.
Creates the parent directory of the receiver File if it doesn't already exist.
performs transform on each line
performs transform on each line
Creates the directories represented by the receiver File if they don't already exist.
Converts all line separators in the receiver string to use \n
.
Appends the specified prefix to this CharSequence and returns the resulting string.
Prepends continuationIndent to every line of the original string.
Adds line breaks and indents to the output of data class toString()
s.
Constructs a Regex
instance by applying the provided builder
function within the context of a RegexBuilderScope
. This enables the creation of complex regular expressions in a more readable and maintainable way.
code golf for replace(regex.toRegex(), replacement)
Wraps a given item in a list.
Wraps a given item in a set.
Returns a list of all elements sorted according to the specified selectors.
Returns a list of all elements sorted according to the specified selectors.
shorthand for splitAndMap(*delimiters) { it.trim() }
shorthand for toString().prettyToString()
, which adds line breaks and indents to a string
Removes the indentation from every line in this string after the first line, and also removes any blank lines appearing before the first non-blank line.