# Selection.RemoveFormatting Method

> Resets all character based formatting attributes of the selected text to its default values. If nothing or more than one paragraph is selected, all paragraph based formatting attributes are also reset.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 32.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > Selection.RemoveFormatting Method
- **518 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/removeformatting-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/removeformatting-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/removeformatting-method/llms-full.txt

---

### Description

Resets all character based formatting attributes of the selected text to its default values. If nothing or more than one paragraph is selected, all paragraph based formatting attributes are also reset.

### Syntax

```csharp
public bool RemoveFormatting();
```

```vbnet
Public Function RemoveFormatting() As Boolean
```

### Return Value

The return value is true, if the operation was successful. Otherwise, it is false.

### Examples

The following example formats the heading of a short document by using `Selection.RemoveFormatting`.

```csharp
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

if (selection.RemoveFormatting())
{
    Console.WriteLine("Remove Formatting completed successfully.");
}
```

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection

If selection.RemoveFormatting() Then
    Console.WriteLine("Remove Formatting completed successfully.")
End If
```

---

## Nearby

- **Previous:** [Selection.ParagraphFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/paragraphformat-property/llms-full.txt)
- **Next:** [Selection.RemoveInlineStyles Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/selection/removeinlinestyles-method/llms-full.txt)
