# TokenizedStringFragments

Fragments of a concatenated string containing stringified Tokens.

Obtainable from: [Tokenization.reverseString](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Tokenization.html#reversestring)

- Source: [`core/lib/string-fragments.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/core/lib/string-fragments.ts#L17)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const tokenizedStringFragments = new cdk.TokenizedStringFragments();
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

tokenized_string_fragments = cdk.TokenizedStringFragments()
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

TokenizedStringFragments tokenizedStringFragments = new TokenizedStringFragments();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var tokenizedStringFragments = new TokenizedStringFragments();
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

tokenizedStringFragments := cdk.NewTokenizedStringFragments()
```

## Initializer

TypeScript:

```ts
new TokenizedStringFragments()
```

Python:

```python
TokenizedStringFragments()
```

Java:

```java
new TokenizedStringFragments()
```

C# / .NET:

```csharp
new TokenizedStringFragments()
```

Golang:

```go
NewTokenizedStringFragments()
```

## Properties

- `firstToken`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `firstValue`: any

- `length`: number

- `tokens`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)[] — Return all Tokens from this string.

## Methods

- `addIntrinsic(value: any): void`

- `addLiteral(lit: any): void`

- `addToken(token: IResolvable): void`

- `join(concat: IFragmentConcatenator): any` — Combine the string fragments using the given joiner.

  If there are any

- `mapTokens(mapper: ITokenMapper): TokenizedStringFragments // chainable` — Apply a transformation function to all tokens in the string.
