JJ.Framework.Text 1.5.6877.41321

Left Right FromTill TakeStart TakeEnd TakeStartUntil TakeEndUntil TrimStartUntil TrimEndUntil TrimFirst TrimLast StartWithCap StartWithLowerCase Repeat SplitWithQuotation StringBuilderWithIndentation ToCamelCase RemoveExcessiveWhiteSpace, overloads for: Split Replace TrimStart TrimEnd

Install-Package JJ.Framework.Text -Version 1.5.6877.41321
dotnet add package JJ.Framework.Text --version 1.5.6877.41321
<PackageReference Include="JJ.Framework.Text" Version="1.5.6877.41321" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JJ.Framework.Text --version 1.5.6877.41321
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

JJ.Framework.Text

Basic helpers for working with text.

  • String extensions for trimming and cutting.
  • Case formatting
  • String.Split overloads
  • SplitWithQuotation
  • StringBuilderWithIndentation

String Extensions

  • Left / Right
    • Returns the left or right part of a string. Throws an exception if the string has less characters than the length provided.
  • FromTill
    • Takes the middle of a string by specifying the zero-based start index and the end index. Throws an exception if the string has less characters than the length provided.
  • TakeStart / TakeEnd
    • Returns the left or right part of a string. Can return less characters than the length provided, if string is shorter.
  • TakeStartUntil / TakeEndUntil
    • Takes the part of a string until the specified delimiter. Excludes the delimiter itself.
  • TrimStart / TrimEnd
    • Will trim off repetitions of the same value from the given string. These are variations of the standard .NET methods that instead of just taking char[] can take a string or a length.
  • TrimStartUntil / TrimEndUntil
    • Cuts off the part of a string until the specified delimiter and returns what remains including the delimiter itself.
  • TrimFirst / TrimLast
    • Will trim off at most one occurrence of a value from the given string.
  • RemoveExcessiveWhiteSpace
    • Trims and replaces sequences of two or more white space characters by a single space.
  • Repeat
    • Repeat a string a number of times, returning a single string.
  • Replace
    • Variation on String.Replace with the ability to ignore case.

String Extensions for Case Formatting

  • StartWithCap
    • Turns the first character into a capital letter.
  • StartWithLowerCase
    • Turns the first character into a lower-case letter.
  • ToCamelCase
    • Converts e.g. "This is a sentence." to "thisIsASentence" so it can be used in code.

SplitWithQuotation

Allows you to parse CSV-like lines including quotation for the ability to include the separator character in the values themselves.

String Split Variations

The notoriously missing String.Split overloads, like:

myString.Split("].");

StringBuilderWithIndentation

You would think StringBuilder might have an Indent and an Unindent method. It doesn't. Here's one that does:

var sb = new StringBuilderWithIndentation();

sb.AppendLine($"public class {generatedClassName}");
sb.AppendLine("{");
sb.Indent();
{
    sb.AppendLine("public void MyMethod()");
    sb.AppendLine("{");
    sb.Indent();
    {
        sb.AppendLine(methodBody);
        sb.Unindent();
    }
    sb.AppendLine("}");
    sb.Unindent();
}
sb.AppendLine("}");

StringHelper.Join

A variation on String.Join, but takes char as the separator instead of String.

JJ.Framework.Text

Basic helpers for working with text.

  • String extensions for trimming and cutting.
  • Case formatting
  • String.Split overloads
  • SplitWithQuotation
  • StringBuilderWithIndentation

String Extensions

  • Left / Right
    • Returns the left or right part of a string. Throws an exception if the string has less characters than the length provided.
  • FromTill
    • Takes the middle of a string by specifying the zero-based start index and the end index. Throws an exception if the string has less characters than the length provided.
  • TakeStart / TakeEnd
    • Returns the left or right part of a string. Can return less characters than the length provided, if string is shorter.
  • TakeStartUntil / TakeEndUntil
    • Takes the part of a string until the specified delimiter. Excludes the delimiter itself.
  • TrimStart / TrimEnd
    • Will trim off repetitions of the same value from the given string. These are variations of the standard .NET methods that instead of just taking char[] can take a string or a length.
  • TrimStartUntil / TrimEndUntil
    • Cuts off the part of a string until the specified delimiter and returns what remains including the delimiter itself.
  • TrimFirst / TrimLast
    • Will trim off at most one occurrence of a value from the given string.
  • RemoveExcessiveWhiteSpace
    • Trims and replaces sequences of two or more white space characters by a single space.
  • Repeat
    • Repeat a string a number of times, returning a single string.
  • Replace
    • Variation on String.Replace with the ability to ignore case.

String Extensions for Case Formatting

  • StartWithCap
    • Turns the first character into a capital letter.
  • StartWithLowerCase
    • Turns the first character into a lower-case letter.
  • ToCamelCase
    • Converts e.g. "This is a sentence." to "thisIsASentence" so it can be used in code.

SplitWithQuotation

Allows you to parse CSV-like lines including quotation for the ability to include the separator character in the values themselves.

String Split Variations

The notoriously missing String.Split overloads, like:

myString.Split("].");

StringBuilderWithIndentation

You would think StringBuilder might have an Indent and an Unindent method. It doesn't. Here's one that does:

var sb = new StringBuilderWithIndentation();

sb.AppendLine($"public class {generatedClassName}");
sb.AppendLine("{");
sb.Indent();
{
    sb.AppendLine("public void MyMethod()");
    sb.AppendLine("{");
    sb.Indent();
    {
        sb.AppendLine(methodBody);
        sb.Unindent();
    }
    sb.AppendLine("}");
    sb.Unindent();
}
sb.AppendLine("}");

StringHelper.Join

A variation on String.Join, but takes char as the separator instead of String.

Dependencies

This package has no dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on JJ.Framework.Text:

Package Downloads
JJ.Framework.Reflection
Expressions like "myParam.MyList[i].MyProperty" can be converted to text or their value retrieved or info like { "MyMethod", Parameters = { "myParameter", int, 3 } } Accessor IsIndexer IsNullableType IsProperty IsReferenceType IsStatic IsSimpleType IsDefault GetBaseClasses GetImplementations GetItemType GetPropertyOrException GetUnderlyingNullableTypeFast TypesFromObjects. ReflectionCache with fast GetProperties GetFields GetConstructor GetTypeByShortName. Overloads for PropertInfo.GetValue IsAssignableFrom IsAssignableTo CreateInstance.
JJ.Framework.Exceptions
Contains many exception classes for common basic errors. Clear messages, concise syntax, strongly-typed, good performance. Generates messages like "myParent.MyChildren[0].MyProperty is null.", "height of 2 is less than 10.", "Customer with key { customerNumber = 1234, customerType = Subscriber } not found."
JJ.Framework.IO
CsvReader FileLock PathParser SafeFileOverwriter GetNumberedFilePath StreamToBytes BytesToStream StreamToString StringToStream StringToBytes BytesToString ReadStruct WriteStruct ClearFolder ClearFolderRecursive GetFolderSize GetFolderSizeRecursive CountFilesRecursive IsFolder IsFile FolderIsEmpty IsReadOnly IsHidden MakeReadOnly MakeWritable ShowFile HideFile ToAbsolutePath ToRelativePath PathsAreEqual AssertFileExists
JJ.Framework.Xml
XmlToObjectConverter converts an XmlDocument or string to an object graph. The way to map XML to classes is easier than the classic ways in .NET. XmlHelper allows you to access XML in a null-safe and multiplicity-safe way. It uses XmlDocument as the underlying .NET API.
JJ.Framework.Business
Classes to support a business logic layer or an API. Keep child-parent relationships in sync. Wrap a result with data along with a Successful flag and a list of messages. Keep business logic units separate, implementing ISideEffect. Check whether a list is dirty.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.5.6877.41321 1,311 10/31/2018
1.4.6869.43189 257 10/22/2018
1.4.6869.43111 266 10/22/2018
1.4.6869.42917 249 10/22/2018
1.4.6869.42092 262 10/22/2018
1.4.6862.40435 793 10/15/2018
1.3.6683.35352 843 4/19/2018
1.2.6640.38990 490 3/7/2018
1.1.0.31223 499 3/4/2018
1.0.6633.36116 420 2/28/2018
1.0.6632.42021 431 2/27/2018
1.0.6632.41567 342 2/27/2018
1.0.6632.38204 414 2/27/2018
1.0.6632.36514 371 2/27/2018
1.0.0.41311 466 2/26/2018
1.0.0 656 2/25/2018