• Intro Headers Instructions Macros
  • Fork me on GitHub
    • Release
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Manifest Annotations
    • Resolving Dependencies
    • Launching
    • Testing
    • Packaging Applications
    • Wrapping Libraries to OSGi Bundles
    • From the command line
    • For Developers
    • Plugins
    • Tools bound to bnd
    • File Format
    • Header Reference
    • Instruction
    • Instruction Index
    • Macro Reference
    • Command Reference
    • Plugins Reference
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
    Supported by OSGi enRoute
  • sublist ';' START ';' END (';' LIST )*

    static String	_sublist	= "${sublist;<start>;<end>;<list>}";
    
    public String _sublist(String args[]) throws Exception {
    	verifyCommand(args, _sublist, null, 4, Integer.MAX_VALUE);
    
    	int start = Integer.parseInt(args[1]);
    	int end = Integer.parseInt(args[2]);
    	ExtList<String> list = toList(args, 3, Integer.MAX_VALUE);
    
    	if (start < 0)
    		start = list.size() + start + 1;
    
    	if (end < 0)
    		end = list.size() + end + 1;
    
    	if (start > end) {
    		int t = start;
    		start = end;
    		end = t;
    	}
    
    	return Processor.join(list.subList(start, end));
    }
    
    • Contact
    • Developers
    • More