Skip to main content
Log in

Mojo function

get_string_literal

get_string_literal[value: String, *extra: StringSlice[StaticConstantOrigin]]() -> StringLiteral

Form a string literal from an arbitrary compile-time String value.

Parameters:

  • value (String): The value to convert to StringLiteral.
  • *extra (StringSlice[StaticConstantOrigin]): Additional StringSlice values to concatenate.

Returns:

The string value as a StringLiteral.

get_string_literal[type: Stringable, //, value: type, *extra: StringSlice[StaticConstantOrigin]]() -> StringLiteral

Form a string literal from an arbitrary compile-time stringable value.

Parameters:

  • type (Stringable): The type of the value.
  • value (type): The value to serialize.
  • *extra (StringSlice[StaticConstantOrigin]): Additional StringSlice values to concatenate.

Returns:

The string value as a StringLiteral.