strings
Utilities for strings
Macros and Functions
chr
returns a string encoding a codepoint
chr returns a string that encodes the single Unicode code
point whose value is specified by the integer i
Example usage (generated):
load("@aspect_bazel_lib//lib:strings.bzl", "chr")
chr(
# position of the character
i = None,
)
i
Required.
position of the character
ord
returns the codepoint of a character
ord(c) returns the integer value of the sole Unicode code point
encoded by the string c
.
If c
does not encode exactly one Unicode code point, ord
fails.
Each invalid code within the string is treated as if it encodes the
Unicode replacement character, U+FFFD.
Example usage (generated):
load("@aspect_bazel_lib//lib:strings.bzl", "ord")
ord(
# character whose codepoint to be returned.
c = None,
)
c
Required.
character whose codepoint to be returned.
hex
Format integer to hexadecimal representation
Example usage (generated):
load("@aspect_bazel_lib//lib:strings.bzl", "hex")
hex(
# number to format
number = None,
)
number
Required.
number to format
split_args
Split a string into a list space separated arguments
Unlike the naive .split(" ")
, this function takes quoted strings
and escapes into account.
Example usage (generated):
load("@aspect_bazel_lib//lib:strings.bzl", "split_args")
split_args(
# input string
s = None,
)
s
Required.
input string