Text

class Text

Text and string manipulation utilities.

Author

Lucas Bubner, 2023

Since

1.0.0-pre

Types

Link copied to clipboard
open class Builder : CharSequence
A modified wrapper of StringBuilder that internally calls formatString on all append calls.
Link copied to clipboard
open class HtmlBuilder
Allows for the building of HTML strings, similar to the DualTelemetry HtmlItem for Driver Station telemetry.

Functions

Link copied to clipboard
open fun builder(): Text.Builder
open fun builder(capacity: Int): Text.Builder
open fun builder(initial: String): Text.Builder
Return a wrapper of StringBuilder that internally calls formatString on all append calls.
Link copied to clipboard
open fun format(@NonNull fstring: String, @Nullable objs: Array<Any>): String
open fun format(@NonNull fstring: String, @Nullable objs: List<Any>): String
Format a string using only '%' placeholders.
Link copied to clipboard
open fun formatString(@NonNull fstring: String, @Nullable objs: Array<Any>): String
open fun formatString(@NonNull fstring: String, @Nullable objs: List<Any>): String
Format a string using only '%' placeholders.
Link copied to clipboard
Get the calling user code function of the current context by looking at the stacktrace until it leaves BunyipsLib.
Link copied to clipboard
Begin building an HTML string.
Link copied to clipboard
open fun lower(str: String): String
Lowercase a string.
Link copied to clipboard
open fun removeHtml(htmlString: String): String
Removes HTML from a string.
Link copied to clipboard
open fun round(@Nullable num: Double, thDigits: Int): Double
open fun round(@Nullable num: Float, thDigits: Int): Float
open fun round(@Nullable num: Double, thDigits: Int, sigFigs: Int): Double
open fun round(@Nullable num: Float, thDigits: Int, sigFigs: Int): Float
Round a number to a certain number of decimal points.
Link copied to clipboard
open fun upper(str: String): String
Uppercase a string.