<!-- Generated by tools/SharpCell.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# Note

```csharp
public sealed class Note
```

Namespace `SharpCell` · package `SharpCell`

A note on a cell: Excel's Insert Note (called a comment before Excel 365), shown in a box beside the cell, by default only while the pointer rests on it. Excel's threaded comments, with replies, are not notes; a file's own are kept when it is saved.

## Constructors

<a id="ctor-string-string"></a>
### Note(string, string)

```csharp
public Note(string text, string? author = null)
```

A note with `text`, written by `author`.

**Parameters**

- `text`: The note's text. Excel puts the author's name and a colon on the first line of a note it makes; SharpCell writes only the text it is given.
- `author`: Who wrote the note, or null for nobody. Excel shows it in the status bar while the pointer rests on the cell.

**Exceptions**

- `ArgumentNullException`: The text is null.
- `ArgumentException`: The text is longer than 32,767 characters, as Excel allows.

## Properties

<a id="author"></a>
### Author

```csharp
public string? Author { get; }
```

Who wrote the note, or null for nobody.

<a id="isvisible"></a>
### IsVisible

```csharp
public bool IsVisible { get; init; }
```

Whether the note is always shown, as Excel's Show/Hide Note makes it; otherwise it is shown only while the pointer rests on its cell.

<a id="text"></a>
### Text

```csharp
public string Text { get; }
```

The text, with `\n` between lines.

## Methods

<a id="equals-note"></a>
### Equals(Note)

```csharp
public bool Equals(Note? other)
```

Whether the other note has the same text, author and visibility, compared ordinally.

<a id="equals-object"></a>
### Equals(object)

```csharp
public override bool Equals(object? obj)
```

Whether `obj` is the same note.

<a id="gethashcode"></a>
### GetHashCode()

```csharp
public override int GetHashCode()
```

A hash code consistent with [Note.Equals](SharpCell.Note.md#equals-note).

<a id="tostring"></a>
### ToString()

```csharp
public override string ToString()
```

The text.
