Skip to main content Link Search Menu Expand Document (external link)

toLower() : Convert to Lowercase


On this page

Summary

Convert a string to lowercase letters.

Signature

toLower(str)

Parameters

Parameter Type Required Description
str String Yes The string to convert

Returns

Type: String

The string converted to lowercase.


Examples

Basic Lowercase

<p></p>

Data:

doc.Params["model"] = new {
    text = "HELLO WORLD"
};

Output:

<p>hello world</p>

Normalize for Comparison


  <span class="badge-active">Active</span>

Data:

doc.Params["model"] = new {
    status = "ACTIVE"
};

Output:

<span class="badge-active">Active</span>

Email Display

<p>Email: </p>

Data:

doc.Params["model"] = new {
    email = "John.Doe@EXAMPLE.COM"
};

Output:

<p>Email: john.doe@example.com</p>

CSS Class Names


  <div class="category-">
    
  </div>

Data:

doc.Params["model"] = new {
    categories = new[] {
        new { name = "Product Reviews" },
        new { name = "Technical Support" }
    }
};

Output:

<div class="category-product-reviews">
  Product Reviews
</div>
<div class="category-technical-support">
  Technical Support
</div>

Notes

  • Converts all uppercase letters to lowercase
  • Leaves numbers and special characters unchanged
  • Culture-dependent (uses current culture)
  • Useful for case-insensitive comparisons
  • Does not modify the original value
  • For uppercase, use toUpper()

See Also