Show / Hide Table of Contents

# Class Format

A helper class for formatting characters.

##### Inheritance

System.Object
Format

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord

###### Assembly: Discord.Net.Core.dll

##### Syntax

    public static class Format

### Methods

| Improve this Doc View Source

#### BlockQuote(String)

Formats a string as a block quote.

##### Declaration

    public static string BlockQuote(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text | The text to format.

##### Returns

Type | Description
--- | ---
System.String | Gets the formatted block quote text.

| Improve this Doc View Source

#### Bold(String)

Returns a markdown-formatted string with bold formatting.

##### Declaration

    public static string Bold(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Code(String, String)

Returns a markdown-formatted string with codeblock formatting.

##### Declaration

    public static string Code(string text, string language = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |
System.String | language |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### EscapeUrl(String)

Escapes a URL so that a preview is not generated.

##### Declaration

    public static string EscapeUrl(string url)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | url |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Italics(String)

Returns a markdown-formatted string with italics formatting.

##### Declaration

    public static string Italics(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Quote(String)

Formats a string as a quote.

##### Declaration

    public static string Quote(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text | The text to format.

##### Returns

Type | Description
--- | ---
System.String | Gets the formatted quote text.

| Improve this Doc View Source

#### Sanitize(String)

Sanitizes the string, safely escaping any Markdown sequences.

##### Declaration

    public static string Sanitize(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Spoiler(String)

Returns a string with spoiler formatting.

##### Declaration

    public static string Spoiler(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Strikethrough(String)

Returns a markdown-formatted string with strikethrough formatting.

##### Declaration

    public static string Strikethrough(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Underline(String)

Returns a markdown-formatted string with underline formatting.

##### Declaration

    public static string Underline(string text)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |

##### Returns

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Url(String, String)

Returns a markdown-formatted URL. Only works in EmbedBuilder descriptions and fields.

##### Declaration

    public static string Url(string text, string url)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | text |
System.String | url |

##### Returns

Type | Description
--- | ---
System.String |