Skip to main content
Version: 2.7.x

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

hex

Format integer to hexdecimal representation

Example usage (generated):

load("@aspect_bazel_lib//lib:strings.bzl", "hex")

hex(
# number to format
number = None,
)

number

Required.

number to format

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.