# Data QnA v1alpha API - Class AnnotatedString (2.0.0-alpha02)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha02 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString)
- [2.0.0-alpha01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/2.0.0-alpha01/Google.Cloud.DataQnA.V1Alpha.AnnotatedString)
- [1.0.0-alpha03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/1.0.0-alpha03/Google.Cloud.DataQnA.V1Alpha.AnnotatedString)

    public sealed class AnnotatedString : IMessage<AnnotatedString>, IEquatable<AnnotatedString>, IDeepCloneable<AnnotatedString>, IBufferMessage, IMessage

Reference documentation and code samples for the Data QnA v1alpha API class AnnotatedString.

Describes string annotation from both semantic and formatting perspectives.
Example:

User Query:

top countries by population in Africa

0 4 14 17 28 31 37

Table Data:

- "country" - dimension
- "population" - metric
- "Africa" - value in the "continent" column

text_formatted = `"top countries by population in Africa"`

html_formatted =
`"top <b>countries</b> by <b>population</b> in <i>Africa</i>"`

    markups = [
      {DIMENSION, 4, 12}, // 'countries'
      {METRIC, 17, 26}, // 'population'
      {FILTER, 31, 36}  // 'Africa'
    ]

Note that html formattings for 'DIMENSION' and 'METRIC' are the same, while
semantic markups are different.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> AnnotatedString

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AnnotatedString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AnnotatedString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AnnotatedString](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.DataQnA.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha)

## Assembly

Google.Cloud.DataQnA.V1Alpha.dll

## Constructors

### AnnotatedString()

    public AnnotatedString()

### AnnotatedString(AnnotatedString)

    public AnnotatedString(AnnotatedString other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString` |

## Properties

### HtmlFormatted

    public string HtmlFormatted { get; set; }

HTML version of the string annotation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Markups

    public RepeatedField<AnnotatedString.Types.SemanticMarkup> Markups { get; }

Semantic version of the string annotation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedStringhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AnnotatedString.Types.SemanticMarkup` |   |

### TextFormatted

    public string TextFormatted { get; set; }

Text version of the string.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |