<!DOCTYPE html>
<html lang="en" ng-app="jpm">

	<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/releases/3.5.0/css/style.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="/js/releases.js"></script>
<!-- Begin Jekyll SEO tag v2.5.0 -->
<title>length STRING</title>
<meta name="generator" content="Jekyll v3.8.5" />
<meta property="og:title" content="length STRING" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="static String _length = &quot;${length;&lt;string&gt;}&quot;;" />
<meta property="og:description" content="static String _length = &quot;${length;&lt;string&gt;}&quot;;" />
<script type="application/ld+json">
{"@type":"WebPage","url":"/releases/3.5.0/macros/length.html","headline":"length STRING","description":"static String _length = &quot;${length;&lt;string&gt;}&quot;;","@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->








































































</head>


<body>


<ul class="container12 menu-bar">
	<li span=11><a class=menu-link href="/releases/3.5.0/"><img
			class=menu-logo src='/releases/3.5.0/img/bnd-80x40-white.png'></a>
			<a href="/releases/3.5.0/chapters/110-introduction.html">Intro
			</a><a href="/releases/3.5.0/chapters/800-headers.html">Headers
			</a><a href="/releases/3.5.0/chapters/820-instructions.html">Instructions
			</a><a href="/releases/3.5.0/chapters/850-macros.html">Macros
			</a><div class="releases"><button class="dropbtn">3.5.0</button><div class="dropdown-content"></div></div>

	<li class=menu-link span=1>
			<a href="https://github.com/bndtools/bnd" target="_"><img
	style="position:absolute;top:0;right:0;margin:0;padding:0;z-index:100"
	src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
	alt="Fork me on GitHub"
	data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
</ul>




	<ul class=container12>
		<li span=3>
			<div>
			<ul class="side-nav">


			<li><a href="/releases/3.5.0/chapters/100-release.html">Release</a>



			<li><a href="/releases/3.5.0/chapters/110-introduction.html">Introduction</a>



			<li><a href="/releases/3.5.0/chapters/120-install.html">How to install bnd</a>



			<li><a href="/releases/3.5.0/chapters/123-tour-workspace.html">Guided Tour</a>



			<li><a href="/releases/3.5.0/chapters/125-tour-features.html">Guided Tour Workspace & Projects</a>



			<li><a href="/releases/3.5.0/chapters/130-concepts.html">Concepts</a>



			<li><a href="/releases/3.5.0/chapters/140-best-practices.html">Best practices</a>



			<li><a href="/releases/3.5.0/chapters/150-build.html">Build</a>



			<li><a href="/releases/3.5.0/chapters/160-jars.html">Generating JARs</a>



			<li><a href="/releases/3.5.0/chapters/170-versioning.html">Versioning</a>



			<li><a href="/releases/3.5.0/chapters/180-baselining.html">Baselining</a>



			<li><a href="/releases/3.5.0/chapters/200-components.html">Service Components</a>



			<li><a href="/releases/3.5.0/chapters/210-metatype.html">Metatype</a>



			<li><a href="/releases/3.5.0/chapters/220-contracts.html">Contracts</a>



			<li><a href="/releases/3.5.0/chapters/230-manifest-annotations.html">Manifest Annotations</a>



			<li><a href="/releases/3.5.0/chapters/250-resolving.html">Resolving Dependencies</a>



			<li><a href="/releases/3.5.0/chapters/300-launching.html">Launching</a>



			<li><a href="/releases/3.5.0/chapters/310-testing.html">Testing</a>



			<li><a href="/releases/3.5.0/chapters/320-packaging.html">Packaging Applications</a>



			<li><a href="/releases/3.5.0/chapters/390-wrapping.html">Wrapping Libraries to OSGi Bundles</a>



			<li><a href="/releases/3.5.0/chapters/400-commandline.html">From the command line</a>



			<li><a href="/releases/3.5.0/chapters/600-developer.html">For Developers</a>



			<li><a href="/releases/3.5.0/chapters/610-plugin.html">Plugins</a>



			<li><a href="/releases/3.5.0/chapters/700-tools.html">Tools bound to bnd</a>



			<li><a href="/releases/3.5.0/chapters/790-format.html">File Format</a>



			<li><a href="/releases/3.5.0/chapters/800-headers.html">Header Reference</a>



			<li><a href="/releases/3.5.0/chapters/820-instructions.html">Instruction</a>



			<li><a href="/releases/3.5.0/chapters/825-instructions-ref.html">Instruction Index</a>



			<li><a href="/releases/3.5.0/chapters/850-macros.html">Macro Reference</a>



			<li><a href="/releases/3.5.0/chapters/860-commands.html">Command Reference</a>



			<li><a href="/releases/3.5.0/chapters/870-plugins.html">Plugins Reference</a>



			<li><a href="/releases/3.5.0/chapters/880-settings.html">Settings</a>



			<li><a href="/releases/3.5.0/chapters/900-errors.html">Errors</a>



			<li><a href="/releases/3.5.0/chapters/910-warnings.html">Warnings</a>



			<li><a href="/releases/3.5.0/chapters/920-faq.html">Frequently Asked Questions</a>


</ul>

			<div class=enroute><a href="http://enroute.osgi.org">Supported by OSGi enRoute <img src="/releases/3.5.0/img/EnRouteIcon_CMYK.png"></a></div>
			</div>

		<li span=9>
			<div class=notes-margin>
				<h1> length STRING</h1>
				<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>static String	_length	= "${length;&lt;string&gt;}";

public int _length(String args[]) throws Exception {
	verifyCommand(args, _length, null, 1, 2);
	if (args.length == 1)
		return 0;

	return args[1].length();
}
</code></pre></div></div>

			</div>
	</ul>


<nav class=next-prev>
	<a href='/releases/3.5.0/macros/lastindexof.html'></a> <a href='/releases/3.5.0/macros/literal.html'></a>
</nav>
<footer class="container12" style="border-top: 1px solid black;padding:10px 0">
	<ul span=12 row>
		<li span=3>
			<ul>
				<li><a href="/releases/3.5.0/contact.html">Contact</a>
			</ul>
		<li span=3>
			<ul>
				<li><a href="/releases/3.5.0/">Developers</a>
			</ul>
		<li span=3>
			<ul>
				<li><a href="/releases/3.5.0/">More</a>
			</ul>
	</ul>
</footer>

</body>
</html>
