SharpStackConvert 1.0.0.2

dotnet add package SharpStackConvert --version 1.0.0.2
NuGet\Install-Package SharpStackConvert -Version 1.0.0.2
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="SharpStackConvert" Version="1.0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpStackConvert --version 1.0.0.2
#r "nuget: SharpStackConvert, 1.0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SharpStackConvert as a Cake Addin
#addin nuget:?package=SharpStackConvert&version=1.0.0.2

// Install SharpStackConvert as a Cake Tool
#tool nuget:?package=SharpStackConvert&version=1.0.0.2

SharpStackConvert

Overview

The SharpStackConvert NuGet package provides a set of extension methods and static class methods for easy conversion of various data types. This document summarizes the classes and methods available in the package.

Classes

TypeConverter

Contains methods for converting objects to various data types.

  • ToDecimal(object input): decimal
  • ToDouble(object input): double
  • CString(object input): string
  • ToInt32(object input): int
  • ToInt64(object input): long
  • ToBool(string input): bool
  • ToBool(object input): bool
  • ToDateTime(object input): DateTime
  • ToInt16(object input): short
  • ToByte(object input): byte
  • ToFloat(object input): float
  • ToGuid(object input): Guid

Base64Converter

Contains methods for encoding and decoding strings and images using Base64.

  • ToBase64(string input, Encoding encoding): string
  • FromBase64(string input, Encoding encoding): string
  • ToBase64(string input): string
  • ImageToBase64(Bitmap bitmap): string
  • FromBase64ToBitmap(string input): Bitmap
  • FromBase64(string input): string
  • ToBase64(byte[] input): string
  • FromBase64ToByteArray(string input): byte[]
  • FromBase64ToByteArray(string input, Encoding encoding): byte[]

CSVConverter

Provides methods for handling CSV (Comma-Separated Values) data.

  • ToCSVFormat(List<string[]> rows, string splitter = ","): string
  • ToCSVFormat(string[,] rows, string splitter = ","): string
  • ToCSVFormat(string[][] rows, string splitter = ","): string
  • SplitLines(string input, bool skipEmptyLines): List<string>
  • CSVToTable(string CSVData, string tableName, bool firstLineIsHeader, char columnSplitter): DataTable

DataTableConverter

Offers methods for converting various string arrays and lists to DataTable objects.

  • ToTable(string[][] rows): DataTable
  • ToTable(string[,] rows): DataTable
  • ToTable(string[] rows): DataTable
  • ToTable(string[] rows, string tableName): DataTable
  • ToTable(string[,] rows, bool firstRowIsHeader): DataTable
  • ToTable(List<string[]> rows, bool firstRowIsHeader, string tableName): DataTable

HashConverter

Static class providing methods for converting data into hash values (MD5, SHA1, SHA256, SHA384, SHA512).

  • ToMD5(string input, Encoding encoding): string
  • ToSHA1(string input, Encoding encoding): string
  • ToSHA256(string input, Encoding encoding): string
  • ToSHA384(string input, Encoding encoding): string
  • ToSHA512(string input, Encoding encoding): string
  • ToSHA1(byte[] input, Encoding encoding): string
  • ToSHA256(byte[] input, Encoding encoding): string
  • ToSHA384(byte[] input, Encoding encoding): string
  • ToSHA512(byte[] input, Encoding encoding): string
  • ToMD5(byte[] input, Encoding encoding): string
  • ToMD5(string input): string
  • ToSHA1(string input): string
  • ToSHA256(string input): string
  • ToSHA384(string input): string
  • ToSHA512(string input): string
  • ToSHA1(byte[] input): string
  • ToSHA256(byte[] input): string
  • ToSHA384(byte[] input): string
  • ToSHA512(byte[] input): string

HTMLConverter

Provides methods for converting HTML content.

  • ToHTMLEscape(string input): string
  • FromHTMLEscape(string input): string

JsonConverter

Static class offering JSON serialization and deserialization methods.

  • JsonToObject<T>(string json): T
  • ObjectToJson<T>(T obj): string

Contributing

Feel free to contribute to the development of this NuGet package. Submit issues or pull requests on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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.0.2 147 1/8/2024
1.0.0.1 157 11/21/2023
1.0.0 101 11/21/2023

This release introduces a host of new classes that significantly enhance the functionality of the package, making data conversion tasks even more streamlined and versatile. The newly added classes include CSVConverter, DataTableConverter, HashConverter, HTMLConverter, and JsonConverter. These classes bring a wealth of methods to handle CSV data, convert between DataTables and various string representations, generate hash values, convert HTML content, and facilitate JSON serialization and deserialization. We believe these additions will empower developers with powerful tools to tackle a broader range of data conversion challenges. Upgrade to the latest version now and explore the enhanced capabilities of SharpStackConvert!