# Welcome

{% hint style="info" %}
*ExtendedTypes* is a small C#/.NET library providing extension methods for boolean and string data types. It is published as a NuGet-Package.
{% endhint %}

{% hint style="warning" %}
*Please note:* I am a hobby programmer, so the way this library is implemented might not adhere to professional standards. I cannot guarantee it is behaving as intended, and am not actively maintaining it.
{% endhint %}

## What does the library offer?

<details>

<summary><strong>Side-stepping the negation operator</strong></summary>

Though the negation operator (`!`) is concise, it is also easy to miss and sometimes has to be put in places where it obstructs or does not align with the natural reading flow.

This library aims to improve the readability and straightforwardness of such statements—and in some cases there conciseness, too.

</details>

<details>

<summary><strong>More concise string manipulation</strong></summary>

The C# string class comes pre-equipped with a variety of useful methods. However, invoking some of them requires rather roundabout statements (e.g. checking whether a string is empty).

This library provides some extension methods to simplify their usage and, additionally, introduces some new ones.

</details>

## Feature Overview

<details>

<summary>Boolean</summary>

Toggle *(i.e. negate the value of)* a boolean variable in a straightforward way:

* [Toggle()](/ExtendedTypes-Docs/boolean/toggle.md) <mark style="color:blue;">— negate instance, no return value.</mark>
* [Toggled()](/ExtendedTypes-Docs/boolean/toggled.md) <mark style="color:blue;">— return negated value, don't change instance.</mark>
  * → *Alias*: **Not()**

</details>

<details>

<summary>String—Null Or Empty Checks</summary>

To check whether a string is null, empty or only consisting of white-space characters, one can use the methods provided by the C# string class:

* `IsNullOrEmpty()` and `IsNullOrWhiteSpace()`

This library offers these build-in methods as extension methods mirroring the behaviour of the pre-existing ones (in fact, internally, it just invokes them).

Additionally, this library offers the negated versions of these methods:

* `IsNotNullOrEmpty()` and `IsNotNullOrWhiteSpace()`

→ [NullOrEmpty-Checks](/ExtendedTypes-Docs/string/nullorempty-checks.md)

</details>

<details>

<summary>String—Whitespace Removal</summary>

Quickly remove superfluous whitespace from a string:

* &#x20;[SquashWhiteSpace()](/ExtendedTypes-Docs/string/squashwhitespace.md) <mark style="color:blue;">— reduce all whitespace to a single space each.</mark>
* [Shrink()](/ExtendedTypes-Docs/string/shrink.md) <mark style="color:blue;">— the same, but trim beforehand.</mark>

</details>

<details>

<summary>String—Removal of Identical Chars</summary>

Compress sequences of identical characters:

* [Condense()](/ExtendedTypes-Docs/string/condense.md)

</details>

## See also

* [GitHub repo](https://github.com/mx-pl/ExtendedTypes_CSharp)
* [NuGet package](https://www.nuget.org/packages/mx-pl.ExtendedTypes)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mx-pl.gitbook.io/ExtendedTypes-Docs/welcome.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
