Documentation Index
Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Fragments of a concatenated string containing stringified Tokens.
Initializers
import cdktn
cdktn.TokenizedStringFragments()
Methods
| Name | Description |
|---|
add_escape | No description. |
add_intrinsic | Adds an intrinsic fragment. |
add_literal | Adds a literal fragment. |
add_token | Adds a token fragment. |
concat | No description. |
join | Combine the string fragments using the given joiner. |
map_tokens | Apply a transformation function to all tokens in the string. |
add_escape
def add_escape(
kind: str
) -> None
kindRequired
add_intrinsic
def add_intrinsic(
value: typing.Any
) -> None
Adds an intrinsic fragment.
valueRequired
the intrinsic value to add.
add_literal
def add_literal(
lit: typing.Any
) -> None
Adds a literal fragment.
litRequired
the literal to add.
add_token
def add_token(
token: IResolvable
) -> None
Adds a token fragment.
tokenRequired
the token to add.
concat
def concat(
other: TokenizedStringFragments
) -> None
otherRequired
join
def join(
concat: IFragmentConcatenator
) -> typing.Any
Combine the string fragments using the given joiner.
If there are any
concatRequired
map_tokens
def map_tokens(
context: IResolveContext
) -> TokenizedStringFragments
Apply a transformation function to all tokens in the string.
contextRequired
Properties
| Name | Type | Description |
|---|
escapes | typing.List[IResolvable] | Return all escape fragments from this string. |
first_value | typing.Any | Returns the first value. |
intrinsic | typing.List[IResolvable] | Return all intrinsic fragments from this string. |
length | typing.Union[int, float] | Returns the number of fragments. |
literals | typing.List[IResolvable] | Return all literals from this string. |
tokens | typing.List[IResolvable] | Return all Tokens from this string. |
first_token | IResolvable | Returns the first token. |
escapesRequired
escapes: typing.List[IResolvable]
Return all escape fragments from this string.
first_valueRequired
Returns the first value.
intrinsicRequired
intrinsic: typing.List[IResolvable]
Return all intrinsic fragments from this string.
lengthRequired
length: typing.Union[int, float]
- Type: typing.Union[int, float]
Returns the number of fragments.
literalsRequired
literals: typing.List[IResolvable]
Return all literals from this string.
tokensRequired
tokens: typing.List[IResolvable]
Return all Tokens from this string.
first_tokenOptional
Returns the first token.