• 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
  • unescape ( ';' STRING )*

    Prev Next
    Macro
    Convert escape sequences to their control characters

    Summary

    The unescape macro converts escape sequences in strings to their corresponding control characters. It concatenates all input arguments and processes escape sequences.

    Syntax

    ${unescape;<string>[;<string>...]}
    

    Parameters

    • string - One or more strings to unescape (concatenated before processing)

    Behavior

    • Concatenates all input arguments
    • Replaces escape sequences with control characters:
      • \n → newline (line feed)
      • \r → carriage return
      • \t → tab
      • \b → backspace
      • \f → form feed
    • Returns the unescaped string

    Examples

    Unescape newline:

    ${unescape;line1\nline2}
    # Returns: "line1
    # line2"
    

    Unescape tab:

    ${unescape;col1\tcol2\tcol3}
    # Returns: "col1	col2	col3"
    

    Multiple strings:

    ${unescape;first\n;second\n;third}
    # Returns: "first
    # second
    # third"
    

    Mixed escapes:

    ${unescape;Name:\tJohn\nAge:\t30}
    

    Use Cases

    • Creating multi-line strings
    • Generating formatted output
    • Processing escape sequences in templates
    • Building tab-delimited data
    • Creating properly formatted text
    • Template processing

    Notes

    • Only specific escape sequences are supported
    • Other backslash sequences remain unchanged
    • All arguments are concatenated before unescaping
    • Useful for creating formatted text in properties
    • Control characters may not display properly in all contexts

    TODO Needs review - AI Generated content


    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home