Cast string that is, sequences of characters.

types.castString(format, value)

Arguments

format

available options are "default", "email", "uri", "binary" and "uuid", where

default

Any valid string.

email

A valid email address.

uri

A valid URI.

binary

A base64 encoded string representing binary data.

uuid

A string that is a uuid.

value

string to cast

See also

Examples

# cast any string types.castString(format = "default", value = "string")
#> [1] "string"
# cast email types.castString(format = "email", value = "name@gmail.com")
#> [1] "name@gmail.com"
# \dontshow{ # cast uri types.castString(format = "uri", value = "http://google.com")
#> [1] "http://google.com"
# } # cast binary types.castString(format = "binary", value = "dGVzdA==")
#> [1] "dGVzdA=="
# cast uuid types.castString(format = "uuid", value = "95ecc380-afe9-11e4-9b6c-751b66dd541e")
#> [1] "95ecc380-afe9-11e4-9b6c-751b66dd541e"