Rop.String 1.0.3

.NET 6.0 .NET Standard 2.0
dotnet add package Rop.String --version 1.0.3
NuGet\Install-Package Rop.String -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rop.String" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rop.String --version 1.0.3
#r "nuget: Rop.String, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rop.String as a Cake Addin
#addin nuget:?package=Rop.String&version=1.0.3

// Install Rop.String as a Cake Tool
#tool nuget:?package=Rop.String&version=1.0.3

Rop.String

Features

Rop.String includes Helper extension classes to manipulate strings.

Char Helper

Helper class char relative

/// Is Equal with case option
public static bool IsEqualCase(this char a, char b, bool ignoreCase = true);
/// Check if a char is included in a char range with case option
public static bool InRange(this char a, IEnumerable<char> range, bool ignoreCase = false);
/// Check if a char is NOT included in a char range with case option
public static bool NotInRange(this char a, IEnumerable<char> range, bool ignoreCase = false);
/// Create a char range from a char to another
public static IEnumerable<char> RangeChar(char from, char to);
/// Create a char range from a char and count elements
public static IEnumerable<char> RangeChar(char from, int count);
/// Trim blank characters (includes carriage returns)
public static string TrimBlanks(this string s);
/// Trim control characters
public static string TrimControl(this string s);

HexString Helper

Helper class hexadecimal strings relative

/// Unicode string to Hex (WideChar)
public static string ToHexStringW(this string str);
/// Hex to Unicode String (Wide)
public static string FromHexStringW(this string hexString);
/// Ascii String to Hex (Byte char)
public static string ToHexString(this string str);
/// Hex String to Ascii String
public static string FromHexString(this string hexString);

StringBuilder helper

Helper class relative to StringBuilder

/// Append Line with linux end of line
public static StringBuilder AppendUnixLine(this StringBuilder std, string value);
/// Append linux end of line
public static StringBuilder AppendUnixLine(this StringBuilder std);

StringCase helper

Helper class relative to Uppercase and Lowercase and Diacritics

/// Remove Diacritics from text
public static string RemoveDiacritics(this string text);
/// Remove diacritics and Lower string
public static string RemoveDiacriticsAndLower(this string text);
/// String starts with (no case)
public static bool StartsWithNoCase(this string a, string b);
/// String ends with (no case)
public static bool EnsWithNoCase(this string a, string b);
/// Equals no case
public static bool EqualsNoCase(this string a, string b);

StringExtracts helper

Helper class relative to Extract substrings

/// Try extract substring from string
public static bool TryExtract(this string a, string prefix, string suffix,bool trim, StringComparison comparer,out string result);
public static bool TryExtract(this string a, string prefix, string suffix, out string result);
public static bool TryExtract(this string a, string prefix, string suffix, bool trim, out string result);
public static bool TryExtract(this string a, string prefix, string suffix, StringComparison comparer,out string result);
/// Try extract substring from string (no case);
public static bool TryExtractNoCase(this string a, string prefix, string suffix, bool trim, out string result);
public static bool TryExtractNoCase(this string a, string prefix, string suffix, out string result);
/// Try extract substring from strins between two strings
public static string Between(this string cad, string left, string right,bool ignorecase = false);
/// Get left part of a string
public static string LeftTo(this string cad, string sep, bool ignorecase = false);
/// Get right part of a string
public static string RightTo(this string cad, string sep, bool ignorecase = false);
/// Breaks a string in two parts
public static (string, string) Break(this string cad, string separator, bool ignorecase = false);
/// Break a string representing a domain account
public static (string Domain, string User) StripDomain(this string cad);
/// Get user part of a string representing a domain account ensuring domain name
public static string StripDomain(this string cad,string ensuredomain);

String helper

General string helper

/// StartsWith including end index
public static bool StartsWith(this string a,string b, StringComparison comparer, out int endindex);
/// EndsWith including begin index
public static bool EndsWith(this string a, string b, StringComparison comparer, out int beginindex);
/// Check if string starts and ends with a prefix and a suffix and returns index of both
public static bool StartsAndEndsWith(this string a, string b,string c, StringComparison comparer, out int from,out int to);
/// Return a substring or empty if parameters out of index
public static string SafeSubstring(this string cad, int from);
/// Return a substring or empty if parameters out of index
public static string SafeSubstring(this string cad, int from, int length, bool spaces = false);
/// Append all strings in a array
public static string ConcatLines(params string[] cads);
/// Return another string if string is null or empty
public static string IfNullOrEmpty(this string cad, string value);
/// Return another string if string is null or empty or whitespace
public static string IfNullOrWhiteSpace(this string cad, string value);
/// Create a dummy string with maximun value
public static string StringMax { get; } = new string(char.MaxValue, 8);
/// Check if string is digit only
public static bool IsDigitOnly(this string cad);
/// Check if cad represents a integer
public static bool IsInteger(this string cad);
/// Get substring beetween two positions.
public static string Between(this string cad, int left, int right, bool spaces = false);
/// Conver bool value into StringComparison value
public static StringComparison ToIgnoreCase(this bool c);

Token helper

String helper to parsing strings

/// Check if a symbol is present in a position
public static string SymbolInPos(this string cad, int pos, IEnumerable<string> symbols, bool ignorecase = false);
public static string SymbolInPos(this string cad, int pos, params string[] symbols);
/// Extract token from string
public static string GetToken(string[] separator, ref string cad, bool ignorecase = false);
/// Check if a string contains a substring
public static bool ContainsCase(this string cad, string search, bool ignorecase = false);   

(C)2022 Ramón Ordiales Plaza

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 208 8/25/2022
1.0.2 246 2/7/2022
1.0.1 225 2/6/2022