View Source Faker.EnGB.PhoneNumber (faker v0.2.0)

Link to this section Summary

Functions

Replaces * signs with random numbers and letters and special characters

Replaces hash signs ('#') and question marks ('?') with random numbers and letters An asterisk ('*') is replaced with either a random number or a random letter

Converts Decimal to Hex

Returns random phone_number

Convert Hex back to decimal

Validate if a string is a vowel or not

Validate if a string is a vowel or not

Replaces all question mark ('?') occurrences with a random letter.

Returns random phone_number

Generates a random integer between two numbers.

Replaces all hash sign ('#') occurrences with a random number Replaces all percentage sign ('%') occurrences with a non-zero number.

Replaces tokens ('{{ tokenName }}') with the result from the token method call

Returns a random ascii code

Generates a random digit between 0 and 9.

Generates a random digit between 0 and 9 except passed parameter.

Generates a random digit between 0 and 9 except passed parameter.

Picks a random element from a list

Generates a random float number between two numbers.

Returns a random letter from a to z

Generates largest possible random value

Returns a shuffled version of the argument. This function accepts either an List, or a string.

Exchange two number positions

Converts string to lowercase

Converts string to lowercase

Link to this section Functions

Link to this function

asciify(string \\ "****")

View Source

Replaces * signs with random numbers and letters and special characters

Returns String

examples

Examples:

iex> Faker.Core.Helper.asciify("**")

  "s5'G!uC3"
Link to this function

bothify(string \\ "## ??")

View Source

Replaces hash signs ('#') and question marks ('?') with random numbers and letters An asterisk ('*') is replaced with either a random number or a random letter

Returns String

examples

Examples

iex> Core.Helper.numerify(### #### ##) "soi styz mn"

Link to this function

dec_to_hex(number, prefix \\ "0")

View Source

Converts Decimal to Hex

Returns random phone_number

Example: +11134567890

Convert Hex back to decimal

Validate if a string is a vowel or not

Returns boolean

examples

Examples

iex> Faker.Core.is_not_vowerl("k")
     false

Validate if a string is a vowel or not

Returns boolean

examples

Examples

iex> Faker.Core.is_vowerl("a")
     true
Link to this function

lexify(string \\ "????")

View Source

Replaces all question mark ('?') occurrences with a random letter.

Returns String

examples

Examples

iex> Core.Helper.numerify(### #### ??) "soi styz mn"

Returns random phone_number

Example: "555-123-546"

Link to this function

number_between(min_number \\ 0, max_number \\ 2_147_483_647)

View Source

Generates a random integer between two numbers.

Returns Integer.

examples

Examples

iex> Faker.Core.number_between(7, 392)
75
Link to this function

numerify(string \\ "###")

View Source

Replaces all hash sign ('#') occurrences with a random number Replaces all percentage sign ('%') occurrences with a non-zero number.

Returns String

examples

Examples

iex> Core.Helper.numerify(### #### ##) "757 7239 65"

Link to this function

parse(string, fill_in_char \\ "?", split_char \\ ".")

View Source

Replaces tokens ('{{ tokenName }}') with the result from the token method call

Returns String

examples

Examples

    iex> Faker.Core.parse("{{first_name}}.{{last_name}}")
         ???????.??????

Returns a random ascii code

Returns String

examples

Examples

iex> Faker.Core.random_ascii
     "!"

Generates a random digit between 0 and 9.

Returns Integer.

examples

Examples

iex> Faker.Core.random_digit()
3
Link to this function

random_digit_not(except)

View Source

Generates a random digit between 0 and 9 except passed parameter.

Returns Integer.

examples

Examples

iex> Faker.Core.random_digit_not(7)
3

Generates a random digit between 0 and 9 except passed parameter.

Returns Integer.

examples

Examples

iex> Faker.Core.random_digit_not_zero(7)
3
Link to this function

random_element(elements)

View Source

Picks a random element from a list

Return List or Tuple

examples

Examples:

      iex> Faker.Core.Helper.random_elements([32, 4, 7, 8])
          32
Link to this function

random_float(maximum_decimals \\ 6, min_number \\ 0, max_number \\ 9)

View Source

Generates a random float number between two numbers.

Returns Float.

examples

Examples

iex> Faker.Core.random_float()
87.3

Returns a random letter from a to z

Returns String

examples

Examples

iex> Faker.Core.random_letter
    "a"
Link to this function

random_maximum(min \\ 2_147_000_000, max \\ 2_147_483_647)

View Source

Generates largest possible random value

Returns a shuffled version of the argument. This function accepts either an List, or a string.

Returns List or String

example

Example:

iex> Faker.Core.shuffle("kamaro")
Link to this function

swap(element_one, element_two)

View Source

Exchange two number positions

Returns Struct

examples

Examples

iex> Faker.Core.swap(element_1, element_2)
    {element_two, element_one}
Link to this function

swap_numbers(number_1, number_2)

View Source

Converts string to lowercase

Returns String

examples

Examples:

iex> Faker.Core.Helper.to_lower("KAMARO")
    "kamaro"

Converts string to lowercase

Returns String

examples

Examples:

iex> Faker.Core.Helper.to_upper("kamaro")
    "KAMARO"