Table of Contents

Class StringManager

Namespace
JJMasterData.Commons.Util
Assembly
JJMasterData.Commons.dll
public static class StringManager
Inheritance
StringManager
Inherited Members

Methods

ClearCpfCnpjChars(string)

public static string ClearCpfCnpjChars(string value)

Parameters

value string

Returns

string

ClearTelChars(string)

public static string ClearTelChars(string value)

Parameters

value string

Returns

string

ClearText(string?)

Clear the text, preventing SQL injection

[Obsolete("This don't prevent SQL injection.")]
public static string ClearText(string? input)

Parameters

input string

Returns

string

Remarks

Author: Lucio Pelinson 21-05-2012

FindValuesByInterval(string, char, char)

Returns a list with all characters between the specified begin and end characters. Example: StringManager.FindValuesByInterval("test[a]foo [b] test" ,'[',']') returns ['a','b'].

public static IEnumerable<string> FindValuesByInterval(string text, char begin, char end)

Parameters

text string
begin char
end char

Returns

IEnumerable<string>

FirstCharToUpper(string)

public static string FirstCharToUpper(this string input)

Parameters

input string

Returns

string

GetAge(string)

Calcula a idade de uma pessoa com base na data atual

public static string GetAge(string data2)

Parameters

data2 string

Data como um string em formato portugues (dd/MM/yyyy)

Returns

string

Devolve um inteiro com a idade. Devolve false em caso de que a data seja incorreta ou maior que o dia atual

GetDataSiga(string)

Converts the date from yyyyMMdd to DateTime

public static DateTime GetDataSiga(string dataString)

Parameters

dataString string

Data at yyyyMMdd format

Returns

DateTime

GetFirstName(string)

Retorna o primeiro nome

public static string GetFirstName(string value)

Parameters

value string

Nome

Returns

string

GetGreeting(IStringLocalizer<MasterDataResources>)

Function to return greeting

public static string GetGreeting(IStringLocalizer<MasterDataResources> stringLocalizer)

Parameters

stringLocalizer IStringLocalizer<MasterDataResources>

Returns

string

Good Morning, Good Afternoon or Good Night. i18n supported.

GetShortName(string)

Retorna o primeiro e o ultimo nome

public static string GetShortName(string value)

Parameters

value string

Nome

Returns

string

GetStringWithoutAccents(string)

Remove os acentos e caracteres especiais

public static string GetStringWithoutAccents(string str)

Parameters

str string

Valor

Returns

string

NumToWords(decimal, bool, bool)

Function to write a number in full in a brazilian format.

public static string NumToWords(decimal valor, bool isCurrency = true, bool isFemale = false)

Parameters

valor decimal

Value, limited to (999.999.999.999.999,00)

isCurrency bool

Write in Reais

isFemale bool

Use a female substantive

Returns

string

Número por extenso

Remarks

Lucio Pelinson 21-02-2013

OnlyNumbers(string)

Remove letras e caracteres especiais

public static string OnlyNumbers(string value)

Parameters

value string

Texto

Returns

string

Retorna somente númetos

ParseBool(object?)

public static bool ParseBool(object? value)

Parameters

value object

Returns

bool

ParseBool(string?)

public static bool ParseBool(string? value)

Parameters

value string

Returns

bool

Soma1(string)

public static string Soma1(string baseVal)

Parameters

baseVal string

Returns

string

ToParamCase(string)

public static string ToParamCase(string input)

Parameters

input string

Returns

string

ToPascalCase(string)

public static string ToPascalCase(string input)

Parameters

input string

Returns

string