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
ClearTelChars(string)
public static string ClearTelChars(string value)
Parameters
value
string
Returns
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
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
Returns
FirstCharToUpper(string)
public static string FirstCharToUpper(this string input)
Parameters
input
string
Returns
GetAge(string)
Calcula a idade de uma pessoa com base na data atual
public static string GetAge(string data2)
Parameters
data2
stringData 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
stringData at yyyyMMdd format
Returns
GetFirstName(string)
Retorna o primeiro nome
public static string GetFirstName(string value)
Parameters
value
stringNome
Returns
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
stringNome
Returns
GetStringWithoutAccents(string)
Remove os acentos e caracteres especiais
public static string GetStringWithoutAccents(string str)
Parameters
str
stringValor
Returns
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
decimalValue, limited to (999.999.999.999.999,00)
isCurrency
boolWrite in Reais
isFemale
boolUse 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
stringTexto
Returns
- string
Retorna somente númetos
ParseBool(object?)
public static bool ParseBool(object? value)
Parameters
value
object
Returns
ParseBool(string?)
public static bool ParseBool(string? value)
Parameters
value
string
Returns
Soma1(string)
public static string Soma1(string baseVal)
Parameters
baseVal
string
Returns
ToParamCase(string)
public static string ToParamCase(string input)
Parameters
input
string
Returns
ToPascalCase(string)
public static string ToPascalCase(string input)
Parameters
input
string