lowercase

lowercase(string)

Returns string with all characters converted to lowercase.

Examples

In the Julia programming language, the function lowercase(string)

Returns the string with all characters converted to lowercase.

julia> lowercase("HELLO")
"hello"

Provide common examples of its use. If there are any common mistakes users make, add an example.

  1. Convert a string to lowercase:

    julia> lowercase("Hello, World!")
    "hello, world!"

    This example converts the string "Hello, World!" to lowercase.

  2. Handle non-alphabetic characters:

    julia> lowercase("123ABC?")
    "123abc?"

    The function handles non-alphabetic characters and only converts alphabetic characters to lowercase.

  3. Combine with other string operations:
    julia> name = "Julia"
    julia> lowercase("Hello, " * name)
    "hello, julia"

    It can be combined with other string operations, such as concatenation, to convert specific parts of a string to lowercase.

Common mistake example:

julia> lowercase(123)
ERROR: MethodError: no method matching lowercase(::Int64)

In this example, an error occurs because the lowercase function expects a string as input, not an integer. Make sure to provide a valid string argument to the lowercase function to avoid such errors.

See Also

ascii, base64decode, Base64DecodePipe, base64encode, Base64EncodePipe, bin, bits, bytestring, charwidth, chomp, chop, chr2ind, contains, endswith, escape_string, graphemes, ind2chr, iscntrl, istext, isupper, isvalid, join, lcfirst, lowercase, lpad, lstrip, normalize_string, num2hex, parseip, randstring, readuntil, replace, repr, rpad, rsplit, rstrip, search, searchindex, split, startswith, string, stringmime, strip, strwidth, summary, takebuf_string, ucfirst, unescape_string, uppercase, utf16, utf32, utf8, wstring,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: