#### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils 'index')
### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils 'Abblix\.Utils')

## StringExtensions Class

The class provides extension methods for enhancing the functionality and ease of use of strings\.

```csharp
public static class StringExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → StringExtensions
### Methods

## StringExtensions\.HasValue\(this string\) Method {#Abblix.Utils.StringExtensions.HasValue(thisstring)}

Determines whether the specified string is neither null nor empty\.

```csharp
public static bool HasValue(this string? value);
```
#### Parameters

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.HasValue(thisstring).value}

The string to test\.

#### Returns
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')  
true if the value parameter is not null or an empty string \(""\); otherwise, false\.

## StringExtensions\.InsertAfter\(this string, string, string\) Method {#Abblix.Utils.StringExtensions.InsertAfter(thisstring,string,string)}

Inserts a specified value into the source string after a specified fragment\.

```csharp
public static string InsertAfter(this string source, string fragment, string value);
```
#### Parameters

###### `source` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.InsertAfter(thisstring,string,string).source}

The source string where the value will be inserted\.

###### `fragment` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.InsertAfter(thisstring,string,string).fragment}

The fragment after which the value will be inserted\.

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.InsertAfter(thisstring,string,string).value}

The value to insert into the source string\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
A new string with the value inserted\.

#### Exceptions

[System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')  
Thrown when the fragment is not found in the source string\.

## StringExtensions\.NotNullOrEmpty\(this string, string\) Method {#Abblix.Utils.StringExtensions.NotNullOrEmpty(thisstring,string)}

Ensures that a string is neither null nor empty, throwing an exception if it is\.

```csharp
public static string NotNullOrEmpty(this string? value, string valueName);
```
#### Parameters

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.NotNullOrEmpty(thisstring,string).value}

The string to validate\.

###### `valueName` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.NotNullOrEmpty(thisstring,string).valueName}

The name of the string variable, used in the exception message\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The original string if it is neither null nor empty\.

#### Exceptions

[System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')  
Thrown if the string is null or empty\.

## StringExtensions\.NotNullOrWhiteSpace\(this string\) Method {#Abblix.Utils.StringExtensions.NotNullOrWhiteSpace(thisstring)}

Determines whether the specified string is not null, empty, or consists only of white\-space characters\.

```csharp
public static bool NotNullOrWhiteSpace(this string? value);
```
#### Parameters

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.NotNullOrWhiteSpace(thisstring).value}

The string to test\.

#### Returns
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')  
true if the value parameter is not null, empty, or whitespace\-only; otherwise, false\.

## StringExtensions\.TrimSuffixIfExists\(this string, string\) Method {#Abblix.Utils.StringExtensions.TrimSuffixIfExists(thisstring,string)}

Trims the specified suffix from the end of the string, if it exists\.

```csharp
public static string TrimSuffixIfExists(this string source, string suffix);
```
#### Parameters

###### `source` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.TrimSuffixIfExists(thisstring,string).source}

The source string to trim\.

###### `suffix` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Utils.StringExtensions.TrimSuffixIfExists(thisstring,string).suffix}

The suffix to remove if it exists at the end of the source string\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The string without the specified suffix\.
