C# Класс Faker.Extensions.StringExtensions

A collection of string helper extensions.
Показать файл Открыть проект

Открытые методы

Метод Описание
AlphanumericOnly ( this s ) : string

Removes all characters which is not Alphanumeric from the specified source

Capitalise ( this s ) : string

Capitalizes the first letter of the given string.

Letterify ( this s ) : string

Get a string with every '?' replaced with a random character from the english alphabet.

Numerify ( this s ) : string

Get a string with every occurrence of '#' replaced with a random number.

Transform ( this s, bool replaceVariables = false ) : string

Transforms the specified source and conditionally replaces variables.

Приватные методы

Метод Описание
AddVariables ( Type classType, IDictionary validVariables ) : void
FormatCulture ( [ format ) : string
FormatInvariant ( [ format ) : string
GetVariable ( string chars, int &index ) : string
GetVariableValue ( string chars, int &index ) : string
Numerify ( this s, bool replaceVariables ) : string

Transform the string replacing # placeholders into a number. Also replaces variables if replaceVariables is set to .

RemoveAccent ( string source ) : string
StringExtensions ( ) : System
Transform ( string s, bool letterify, bool numerify, bool replaceVariables ) : IEnumerable

Описание методов

AlphanumericOnly() публичный статический Метод

Removes all characters which is not Alphanumeric from the specified source
public static AlphanumericOnly ( this s ) : string
s this The source string.
Результат string

Capitalise() публичный статический Метод

Capitalizes the first letter of the given string.
public static Capitalise ( this s ) : string
s this The source string.
Результат string

Letterify() публичный статический Метод

Get a string with every '?' replaced with a random character from the english alphabet.
public static Letterify ( this s ) : string
s this The source format
Результат string

Numerify() публичный статический Метод

Get a string with every occurrence of '#' replaced with a random number.
public static Numerify ( this s ) : string
s this The source format.
Результат string

Transform() публичный статический Метод

Transforms the specified source and conditionally replaces variables.
public static Transform ( this s, bool replaceVariables = false ) : string
s this The s.
replaceVariables bool /// if set to replace variables in the string. ///
Результат string