> For the complete documentation index, see [llms.txt](https://gabriel-schade-cardoso.gitbook.io/tango/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gabriel-schade-cardoso.gitbook.io/tango/operations/string.md).

# Operations with Strings

> [`Tango.CommonOperations.StringOperations`](https://github.com/gabrielschade/Tango/blob/master/Tango/Tango/Operations/StringOperations.cs)

This *static* class contains methods and properties to expose common operations to work with `string` types.

All members bellow returns the corresponding functions as delegates.

## Properties

| Name    | Type                          | Description                                                                        |
| ------- | ----------------------------- | ---------------------------------------------------------------------------------- |
| Concat  | Func\<string, string>         | Function to represents concatenation operation string.Concat between two values.   |
| Concat3 | Func\<string, string, string> | Function to represents concatenation operation string.Concat between three values. |

## Methods

| Name        | Parameters                              | Returns                       | Description                                                                                                                                                     |
| ----------- | --------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ConcatWith  | string value                            | Func\<string, string>         | Function to represents concatenation operation string.Concat between two values, applying first value as partial application on Concat function.                |
| Concat3With | string value                            | Func\<string, string, string> | Function to represents concatenation operation string.Concat between three values, applying first value as partial application on Concat3 function.             |
| Concat3With | <p>string value</p><p>string value2</p> | Func\<string, string>         | Function to represents concatenation operation string.Concat between three values, applying first and second values as partial application on Concat3 function. |

## Usage

The properties returns a delegate, so, it's possible to use it as a method.

&#x20;**Concat**

```csharp
string value = "Hello";
string value2 = " World";
string result = StringOperations.Concat(value, value2);

//result= "Hello World"
```

&#x20;**Concat3**

```csharp
string value = "Hello";
string value2 = " my ";
string value3 = "World";
string result = StringOperations.Concat3(value, value2, value3);

//result= "Hello my World"
```

Para os métodos temos uma sintaxe um pouco diferente, isso porque é realizada uma aplicação parcial ao método retornado pela própriedade.

Por conta disso, precisamos executar o método com os primeiros parâmetros, para obtermos um novo método que espera os parâmetros restantes:

&#x20;**ConcatWith**

```csharp
string value = "Hello";
string value2 = " World";
Func<string, string> concatWith = StringOperations.ConcatWith(value);
string result = concatWith(value2);

//result= "Hello World"
```

You can also use it as a chainable operation:

```csharp
string value = "Hello";
string value2 = " World";
string result = StringOperations.ConcatWith(value)(value2);

//result= "Hello World"
```

The *\~With* operations are available to `Concat3` as well, it follows the same caracteristics that the previous example.

&#x20;**Concat3With**

```csharp
string value = "Hello";
string value2 = " my ";
string value3 = "World";
Func<string, string, string> concat3With= StringOperations.Concat3With(value);
string result = concat3With(value2, value3);

//result= "Hello my World"
```

You can also use it as a chainable operation:

```csharp
string value = "Hello";
string value2 = " my ";
string value3 = "World";
string result = StringOperations.Concat3With(value)(value2, value3);

//result= "Hello my World"
```

You can use the two parameters overload as well:

```csharp
string value = "Hello";
string value2 = " my ";
string value3 = "World";
Func<string, string> concat3With= StringOperations.Concat3With(value, value2);
string result = concat3With(value3);

//result= "Hello my World"
```

```csharp
string value = "Hello";
string value2 = " my ";
string value3 = "World";
string result = StringOperations.Concat3With(value, value2)(value3);

//result= "Hello my World"
```
