• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • bnd CLI Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • tolower STRING

    Prev Next
    Macro
    Convert a string to lowercase

    Summary

    The tolower macro converts a string to lowercase using the default locale.

    Syntax

    ${tolower;<string>}
    

    Parameters

    • string - The string to convert to lowercase

    Behavior

    • Converts all uppercase letters to lowercase
    • Uses default locale for conversion
    • Non-letter characters remain unchanged
    • Returns the lowercase string

    Examples

    Convert simple string:

    ${tolower;HELLO WORLD}
    # Returns: "hello world"
    

    Convert mixed case:

    ${tolower;MyClassName}
    # Returns: "myclassname"
    

    Normalize for comparison:

    ${if;${equals;${tolower;${input}};${tolower;${expected}}};match;no-match}
    

    Convert package names:

    normalized=${tolower;Com.Example.API}
    # Returns: "com.example.api"
    

    Use Cases

    • Normalizing strings for comparison
    • Converting user input to standard format
    • Creating lowercase identifiers
    • Case-insensitive matching
    • Formatting output consistently

    Notes

    • Uses default locale conversion rules
    • See also: ${toupper} for uppercase conversion
    • Locale-sensitive for certain characters

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home