| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.11) on Wed Jul 07 10:52:27 EDT 2021 --> |
| <title>StringUtil (Jetty :: Project 9.4.43.v20210629 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2021-07-07"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="StringUtil (Jetty :: Project 9.4.43.v20210629 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9,"i22":9,"i23":9,"i24":9,"i25":9,"i26":9,"i27":9,"i28":9,"i29":9,"i30":9,"i31":41,"i32":41,"i33":9,"i34":9,"i35":9,"i36":9,"i37":9,"i38":9,"i39":9,"i40":41,"i41":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/StringUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.eclipse.jetty.util</a></div> |
| <h2 title="Class StringUtil" class="title">Class StringUtil</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.eclipse.jetty.util.StringUtil</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">StringUtil</span> |
| extends java.lang.Object</pre> |
| <div class="block">Fast String Utilities. |
| |
| These string utilities provide both convenience methods and |
| performance improvements over most standard library versions. The |
| main aim of the optimizations is to avoid object creation unless |
| absolutely required.</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#__ISO_8859_1">__ISO_8859_1</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#__LINE_SEPARATOR">__LINE_SEPARATOR</a></span></code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">use <code>System.lineSeparator()</code> instead</div> |
| </div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#__UTF16">__UTF16</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#__UTF8">__UTF8</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ALL_INTERFACES">ALL_INTERFACES</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CRLF">CRLF</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static char[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#lowercases">lowercases</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">StringUtil</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.StringBuilder,byte,int)">append</a></span>​(java.lang.StringBuilder buf, |
| byte b, |
| int base)</code></th> |
| <td class="colLast"> |
| <div class="block">append hex digit</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.lang.StringBuilder,java.lang.String,int,int)">append</a></span>​(java.lang.StringBuilder buf, |
| java.lang.String s, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Append substring to StringBuilder</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append2digits(java.lang.StringBuffer,int)">append2digits</a></span>​(java.lang.StringBuffer buf, |
| int i)</code></th> |
| <td class="colLast"> |
| <div class="block">Append 2 digits (zero padded) to the StringBuffer</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append2digits(java.lang.StringBuilder,int)">append2digits</a></span>​(java.lang.StringBuilder buf, |
| int i)</code></th> |
| <td class="colLast"> |
| <div class="block">Append 2 digits (zero padded) to the StringBuilder</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#arrayFromString(java.lang.String)">arrayFromString</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">Parse the string representation of a list using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asciiToLowerCase(java.lang.String)">asciiToLowerCase</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">fast lower case conversion.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#csvSplit(java.lang.String)">csvSplit</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">Parse a CSV string using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#csvSplit(java.lang.String,int,int)">csvSplit</a></span>​(java.lang.String s, |
| int off, |
| int len)</code></th> |
| <td class="colLast"> |
| <div class="block">Parse a CSV string using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static java.util.List<java.lang.String></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#csvSplit(java.util.List,java.lang.String,int,int)">csvSplit</a></span>​(java.util.List<java.lang.String> list, |
| java.lang.String s, |
| int off, |
| int len)</code></th> |
| <td class="colLast"> |
| <div class="block">Split a quoted comma separated string to a list</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#endsWithIgnoreCase(java.lang.String,java.lang.String)">endsWithIgnoreCase</a></span>​(java.lang.String s, |
| java.lang.String w)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.String,char%5B%5D,int,int)">equals</a></span>​(java.lang.String s, |
| char[] buf, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBytes(java.lang.String)">getBytes</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBytes(java.lang.String,java.lang.String)">getBytes</a></span>​(java.lang.String s, |
| java.lang.String charset)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUtf8Bytes(java.lang.String)">getUtf8Bytes</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#indexFrom(java.lang.String,java.lang.String)">indexFrom</a></span>​(java.lang.String s, |
| java.lang.String chars)</code></th> |
| <td class="colLast"> |
| <div class="block">returns the next index of a character from the chars string</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#indexOfControlChars(java.lang.String)">indexOfControlChars</a></span>​(java.lang.String str)</code></th> |
| <td class="colLast"> |
| <div class="block">Find the index of a control characters in String</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isBlank(java.lang.String)">isBlank</a></span>​(java.lang.String str)</code></th> |
| <td class="colLast"> |
| <div class="block">Test if a string is null or only has whitespace characters in it.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty(java.lang.String)">isEmpty</a></span>​(java.lang.String str)</code></th> |
| <td class="colLast"> |
| <div class="block">Checks if a String is empty ("") or null.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isHex(java.lang.String,int,int)">isHex</a></span>​(java.lang.String str, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNotBlank(java.lang.String)">isNotBlank</a></span>​(java.lang.String str)</code></th> |
| <td class="colLast"> |
| <div class="block">Test if a string is not null and contains at least 1 non-whitespace characters in it.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isUTF8(java.lang.String)">isUTF8</a></span>​(java.lang.String charset)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#nonNull(java.lang.String)">nonNull</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">Return a non null string.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalizeCharset(java.lang.String)">normalizeCharset</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert alternate charset names (eg utf8) to normalized |
| name (eg UTF-8).</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalizeCharset(java.lang.String,int,int)">normalizeCharset</a></span>​(java.lang.String s, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert alternate charset names (eg utf8) to normalized |
| name (eg UTF-8).</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#printable(byte%5B%5D)">printable</a></span>​(byte[] b)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#printable(java.lang.String)">printable</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replace(java.lang.String,char,char)">replace</a></span>​(java.lang.String str, |
| char find, |
| char with)</code></th> |
| <td class="colLast"> |
| <div class="block">Replace chars within string.</div> |
| </td> |
| </tr> |
| <tr id="i27" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replace(java.lang.String,java.lang.String,java.lang.String)">replace</a></span>​(java.lang.String s, |
| java.lang.String sub, |
| java.lang.String with)</code></th> |
| <td class="colLast"> |
| <div class="block">Replace substrings within string.</div> |
| </td> |
| </tr> |
| <tr id="i28" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replaceFirst(java.lang.String,java.lang.String,java.lang.String)">replaceFirst</a></span>​(java.lang.String original, |
| java.lang.String target, |
| java.lang.String replacement)</code></th> |
| <td class="colLast"> |
| <div class="block">Replace first substrings within string.</div> |
| </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sanitizeFileSystemName(java.lang.String)">sanitizeFileSystemName</a></span>​(java.lang.String str)</code></th> |
| <td class="colLast"> |
| <div class="block">Replace all characters from input string that are known to have |
| special meaning in various filesystems.</div> |
| </td> |
| </tr> |
| <tr id="i30" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sanitizeXmlString(java.lang.String)">sanitizeXmlString</a></span>​(java.lang.String html)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i31" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sidBytesToString(byte%5B%5D)">sidBytesToString</a></span>​(byte[] sidBytes)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i32" class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sidStringToBytes(java.lang.String)">sidStringToBytes</a></span>​(java.lang.String sidString)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i33" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startsWithIgnoreCase(java.lang.String,java.lang.String)">startsWithIgnoreCase</a></span>​(java.lang.String s, |
| java.lang.String w)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i34" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#strip(java.lang.String,java.lang.String)">strip</a></span>​(java.lang.String str, |
| java.lang.String find)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i35" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toInt(java.lang.String,int)">toInt</a></span>​(java.lang.String string, |
| int from)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert String to an integer.</div> |
| </td> |
| </tr> |
| <tr id="i36" class="altColor"> |
| <td class="colFirst"><code>static long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toLong(java.lang.String)">toLong</a></span>​(java.lang.String string)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert String to an long.</div> |
| </td> |
| </tr> |
| <tr id="i37" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString(byte%5B%5D,int,int,java.lang.String)">toString</a></span>​(byte[] b, |
| int offset, |
| int length, |
| java.lang.String charset)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i38" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toUTF8String(byte%5B%5D,int,int)">toUTF8String</a></span>​(byte[] b, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i39" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#truncate(java.lang.String,int)">truncate</a></span>​(java.lang.String str, |
| int maxSize)</code></th> |
| <td class="colLast"> |
| <div class="block">Truncate a string to a max size.</div> |
| </td> |
| </tr> |
| <tr id="i40" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unquote(java.lang.String)">unquote</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i41" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#valueOf(java.lang.Object)">valueOf</a></span>​(java.lang.Object object)</code></th> |
| <td class="colLast"> |
| <div class="block">The String value of an Object</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="ALL_INTERFACES"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>ALL_INTERFACES</h4> |
| <pre>public static final java.lang.String ALL_INTERFACES</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.util.StringUtil.ALL_INTERFACES">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="CRLF"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>CRLF</h4> |
| <pre>public static final java.lang.String CRLF</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.util.StringUtil.CRLF">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="__LINE_SEPARATOR"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>__LINE_SEPARATOR</h4> |
| <pre>@Deprecated |
| public static final java.lang.String __LINE_SEPARATOR</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">use <code>System.lineSeparator()</code> instead</div> |
| </div> |
| </li> |
| </ul> |
| <a id="__ISO_8859_1"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>__ISO_8859_1</h4> |
| <pre>public static final java.lang.String __ISO_8859_1</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.util.StringUtil.__ISO_8859_1">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="__UTF8"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>__UTF8</h4> |
| <pre>public static final java.lang.String __UTF8</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.util.StringUtil.__UTF8">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="__UTF16"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>__UTF16</h4> |
| <pre>public static final java.lang.String __UTF16</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.util.StringUtil.__UTF16">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="lowercases"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>lowercases</h4> |
| <pre>public static final char[] lowercases</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>StringUtil</h4> |
| <pre>public StringUtil()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="normalizeCharset(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>normalizeCharset</h4> |
| <pre class="methodSignature">public static java.lang.String normalizeCharset​(java.lang.String s)</pre> |
| <div class="block">Convert alternate charset names (eg utf8) to normalized |
| name (eg UTF-8).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the charset to normalize</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the normalized charset (or null if normalized version not found)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="normalizeCharset(java.lang.String,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>normalizeCharset</h4> |
| <pre class="methodSignature">public static java.lang.String normalizeCharset​(java.lang.String s, |
| int offset, |
| int length)</pre> |
| <div class="block">Convert alternate charset names (eg utf8) to normalized |
| name (eg UTF-8).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the charset to normalize</dd> |
| <dd><code>offset</code> - the offset in the charset</dd> |
| <dd><code>length</code> - the length of the charset in the input param</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the normalized charset (or null if not found)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="asciiToLowerCase(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asciiToLowerCase</h4> |
| <pre class="methodSignature">public static java.lang.String asciiToLowerCase​(java.lang.String s)</pre> |
| <div class="block">fast lower case conversion. Only works on ascii (not unicode)</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the string to convert</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a lower case version of s</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="sanitizeFileSystemName(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>sanitizeFileSystemName</h4> |
| <pre class="methodSignature">public static java.lang.String sanitizeFileSystemName​(java.lang.String str)</pre> |
| <div class="block">Replace all characters from input string that are known to have |
| special meaning in various filesystems. |
| |
| <p> |
| This will replace all of the following characters |
| with a "<code>_</code>" (underscore). |
| </p> |
| <ul> |
| <li>Control Characters</li> |
| <li>Anything not 7-bit printable ASCII</li> |
| <li>Special characters: pipe, redirect, combine, slash, equivalence, bang, glob, selection, etc...</li> |
| <li>Space</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the raw input string</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the sanitized output string. or null if <code>str</code> is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="startsWithIgnoreCase(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>startsWithIgnoreCase</h4> |
| <pre class="methodSignature">public static boolean startsWithIgnoreCase​(java.lang.String s, |
| java.lang.String w)</pre> |
| </li> |
| </ul> |
| <a id="endsWithIgnoreCase(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>endsWithIgnoreCase</h4> |
| <pre class="methodSignature">public static boolean endsWithIgnoreCase​(java.lang.String s, |
| java.lang.String w)</pre> |
| </li> |
| </ul> |
| <a id="indexFrom(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>indexFrom</h4> |
| <pre class="methodSignature">public static int indexFrom​(java.lang.String s, |
| java.lang.String chars)</pre> |
| <div class="block">returns the next index of a character from the chars string</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the input string to search</dd> |
| <dd><code>chars</code> - the chars to look for</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index of the character in the input stream found.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="replace(java.lang.String,char,char)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>replace</h4> |
| <pre class="methodSignature">public static java.lang.String replace​(java.lang.String str, |
| char find, |
| char with)</pre> |
| <div class="block">Replace chars within string. |
| <p> |
| Fast replacement for <code>java.lang.String#</code><code>String.replace(char, char)</code> |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the input string</dd> |
| <dd><code>find</code> - the char to look for</dd> |
| <dd><code>with</code> - the char to replace with</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the now replaced string</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="replace(java.lang.String,java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>replace</h4> |
| <pre class="methodSignature">public static java.lang.String replace​(java.lang.String s, |
| java.lang.String sub, |
| java.lang.String with)</pre> |
| <div class="block">Replace substrings within string. |
| <p> |
| Fast replacement for <code>java.lang.String#</code><code>String.replace(CharSequence, CharSequence)</code> |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the input string</dd> |
| <dd><code>sub</code> - the string to look for</dd> |
| <dd><code>with</code> - the string to replace with</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the now replaced string</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="replaceFirst(java.lang.String,java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>replaceFirst</h4> |
| <pre class="methodSignature">public static java.lang.String replaceFirst​(java.lang.String original, |
| java.lang.String target, |
| java.lang.String replacement)</pre> |
| <div class="block">Replace first substrings within string. |
| <p> |
| Fast replacement for <code>java.lang.String#</code><code>String.replaceFirst(String, String)</code>, but without |
| Regex support. |
| </p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>original</code> - the original string</dd> |
| <dd><code>target</code> - the target string to look for</dd> |
| <dd><code>replacement</code> - the replacement string to use</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the replaced string</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="unquote(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>unquote</h4> |
| <pre class="methodSignature">@Deprecated |
| public static java.lang.String unquote​(java.lang.String s)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Remove single or double quotes.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the input string</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the string with quotes removed</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.lang.StringBuilder,java.lang.String,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.lang.StringBuilder buf, |
| java.lang.String s, |
| int offset, |
| int length)</pre> |
| <div class="block">Append substring to StringBuilder</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - StringBuilder to append to</dd> |
| <dd><code>s</code> - String to append from</dd> |
| <dd><code>offset</code> - The offset of the substring</dd> |
| <dd><code>length</code> - The length of the substring</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.lang.StringBuilder,byte,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.lang.StringBuilder buf, |
| byte b, |
| int base)</pre> |
| <div class="block">append hex digit</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to append to</dd> |
| <dd><code>b</code> - the byte to append</dd> |
| <dd><code>base</code> - the base of the hex output (almost always 16).</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append2digits(java.lang.StringBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append2digits</h4> |
| <pre class="methodSignature">public static void append2digits​(java.lang.StringBuffer buf, |
| int i)</pre> |
| <div class="block">Append 2 digits (zero padded) to the StringBuffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to append to</dd> |
| <dd><code>i</code> - the value to append</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append2digits(java.lang.StringBuilder,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append2digits</h4> |
| <pre class="methodSignature">public static void append2digits​(java.lang.StringBuilder buf, |
| int i)</pre> |
| <div class="block">Append 2 digits (zero padded) to the StringBuilder</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to append to</dd> |
| <dd><code>i</code> - the value to append</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="nonNull(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nonNull</h4> |
| <pre class="methodSignature">public static java.lang.String nonNull​(java.lang.String s)</pre> |
| <div class="block">Return a non null string.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - String</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The string passed in or empty string if it is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equals(java.lang.String,char[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre class="methodSignature">public static boolean equals​(java.lang.String s, |
| char[] buf, |
| int offset, |
| int length)</pre> |
| </li> |
| </ul> |
| <a id="toUTF8String(byte[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toUTF8String</h4> |
| <pre class="methodSignature">public static java.lang.String toUTF8String​(byte[] b, |
| int offset, |
| int length)</pre> |
| </li> |
| </ul> |
| <a id="toString(byte[],int,int,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static java.lang.String toString​(byte[] b, |
| int offset, |
| int length, |
| java.lang.String charset)</pre> |
| </li> |
| </ul> |
| <a id="indexOfControlChars(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>indexOfControlChars</h4> |
| <pre class="methodSignature">public static int indexOfControlChars​(java.lang.String str)</pre> |
| <div class="block">Find the index of a control characters in String |
| <p> |
| This will return a result on the first occurrence of a control character, regardless if |
| there are more than one. |
| </p> |
| <p> |
| Note: uses codepoint version of <code>Character.isISOControl(int)</code> to support Unicode better. |
| </p> |
| |
| <pre> |
| indexOfControlChars(null) == -1 |
| indexOfControlChars("") == -1 |
| indexOfControlChars("\r\n") == 0 |
| indexOfControlChars("\t") == 0 |
| indexOfControlChars(" ") == -1 |
| indexOfControlChars("a") == -1 |
| indexOfControlChars(".") == -1 |
| indexOfControlChars(";\n") == 1 |
| indexOfControlChars("abc\f") == 3 |
| indexOfControlChars("z\010") == 1 |
| indexOfControlChars(":") == 1 |
| </pre></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the string to test.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the index of first control character in string, -1 if no control characters encountered</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isBlank(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isBlank</h4> |
| <pre class="methodSignature">public static boolean isBlank​(java.lang.String str)</pre> |
| <div class="block">Test if a string is null or only has whitespace characters in it. |
| <p> |
| Note: uses codepoint version of <code>Character.isWhitespace(int)</code> to support Unicode better. |
| |
| <pre> |
| isBlank(null) == true |
| isBlank("") == true |
| isBlank("\r\n") == true |
| isBlank("\t") == true |
| isBlank(" ") == true |
| isBlank("a") == false |
| isBlank(".") == false |
| isBlank(";\n") == false |
| </pre></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the string to test.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if string is null or only whitespace characters, false if non-whitespace characters encountered.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isEmpty(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre class="methodSignature">public static boolean isEmpty​(java.lang.String str)</pre> |
| <div class="block"><p>Checks if a String is empty ("") or null.</p> |
| |
| <pre> |
| isEmpty(null) == true |
| isEmpty("") == true |
| isEmpty("\r\n") == false |
| isEmpty("\t") == false |
| isEmpty(" ") == false |
| isEmpty("a") == false |
| isEmpty(".") == false |
| isEmpty(";\n") == false |
| </pre></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the string to test.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if string is null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isNotBlank(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isNotBlank</h4> |
| <pre class="methodSignature">public static boolean isNotBlank​(java.lang.String str)</pre> |
| <div class="block">Test if a string is not null and contains at least 1 non-whitespace characters in it. |
| <p> |
| Note: uses codepoint version of <code>Character.isWhitespace(int)</code> to support Unicode better. |
| |
| <pre> |
| isNotBlank(null) == false |
| isNotBlank("") == false |
| isNotBlank("\r\n") == false |
| isNotBlank("\t") == false |
| isNotBlank(" ") == false |
| isNotBlank("a") == true |
| isNotBlank(".") == true |
| isNotBlank(";\n") == true |
| </pre></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the string to test.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if string is not null and has at least 1 non-whitespace character, false if null or all-whitespace characters.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isUTF8(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isUTF8</h4> |
| <pre class="methodSignature">public static boolean isUTF8​(java.lang.String charset)</pre> |
| </li> |
| </ul> |
| <a id="isHex(java.lang.String,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isHex</h4> |
| <pre class="methodSignature">public static boolean isHex​(java.lang.String str, |
| int offset, |
| int length)</pre> |
| </li> |
| </ul> |
| <a id="printable(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>printable</h4> |
| <pre class="methodSignature">public static java.lang.String printable​(java.lang.String name)</pre> |
| </li> |
| </ul> |
| <a id="printable(byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>printable</h4> |
| <pre class="methodSignature">public static java.lang.String printable​(byte[] b)</pre> |
| </li> |
| </ul> |
| <a id="getBytes(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBytes</h4> |
| <pre class="methodSignature">public static byte[] getBytes​(java.lang.String s)</pre> |
| </li> |
| </ul> |
| <a id="getUtf8Bytes(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getUtf8Bytes</h4> |
| <pre class="methodSignature">public static byte[] getUtf8Bytes​(java.lang.String s)</pre> |
| </li> |
| </ul> |
| <a id="getBytes(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBytes</h4> |
| <pre class="methodSignature">public static byte[] getBytes​(java.lang.String s, |
| java.lang.String charset)</pre> |
| </li> |
| </ul> |
| <a id="sidBytesToString(byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>sidBytesToString</h4> |
| <pre class="methodSignature">@Deprecated |
| public static java.lang.String sidBytesToString​(byte[] sidBytes)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Converts a binary SID to a string SID |
| |
| http://en.wikipedia.org/wiki/Security_Identifier |
| |
| S-1-IdentifierAuthority-SubAuthority1-SubAuthority2-...-SubAuthorityn</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>sidBytes</code> - the SID bytes to build from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the string SID</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="sidStringToBytes(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>sidStringToBytes</h4> |
| <pre class="methodSignature">@Deprecated |
| public static byte[] sidStringToBytes​(java.lang.String sidString)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Converts a string SID to a binary SID |
| |
| http://en.wikipedia.org/wiki/Security_Identifier |
| |
| S-1-IdentifierAuthority-SubAuthority1-SubAuthority2-...-SubAuthorityn</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>sidString</code> - the string SID</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the binary SID</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toInt(java.lang.String,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toInt</h4> |
| <pre class="methodSignature">public static int toInt​(java.lang.String string, |
| int from)</pre> |
| <div class="block">Convert String to an integer. Parses up to the first non-numeric character. If no number is found an IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>string</code> - A String containing an integer.</dd> |
| <dd><code>from</code> - The index to start parsing from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toLong(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toLong</h4> |
| <pre class="methodSignature">public static long toLong​(java.lang.String string)</pre> |
| <div class="block">Convert String to an long. Parses up to the first non-numeric character. If no number is found an IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>string</code> - A String containing an integer.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="truncate(java.lang.String,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>truncate</h4> |
| <pre class="methodSignature">public static java.lang.String truncate​(java.lang.String str, |
| int maxSize)</pre> |
| <div class="block">Truncate a string to a max size.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>str</code> - the string to possibly truncate</dd> |
| <dd><code>maxSize</code> - the maximum size of the string</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the truncated string. if <code>str</code> param is null, then the returned string will also be null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="arrayFromString(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>arrayFromString</h4> |
| <pre class="methodSignature">public static java.lang.String[] arrayFromString​(java.lang.String s)</pre> |
| <div class="block">Parse the string representation of a list using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - The string to parse, expected to be enclosed as '[...]'</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>An array of parsed values.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="csvSplit(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>csvSplit</h4> |
| <pre class="methodSignature">public static java.lang.String[] csvSplit​(java.lang.String s)</pre> |
| <div class="block">Parse a CSV string using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - The string to parse</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>An array of parsed values.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="csvSplit(java.lang.String,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>csvSplit</h4> |
| <pre class="methodSignature">public static java.lang.String[] csvSplit​(java.lang.String s, |
| int off, |
| int len)</pre> |
| <div class="block">Parse a CSV string using <a href="#csvSplit(java.util.List,java.lang.String,int,int)"><code>csvSplit(List, String, int, int)</code></a></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - The string to parse</dd> |
| <dd><code>off</code> - The offset into the string to start parsing</dd> |
| <dd><code>len</code> - The len in characters to parse</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>An array of parsed values.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="csvSplit(java.util.List,java.lang.String,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>csvSplit</h4> |
| <pre class="methodSignature">public static java.util.List<java.lang.String> csvSplit​(java.util.List<java.lang.String> list, |
| java.lang.String s, |
| int off, |
| int len)</pre> |
| <div class="block">Split a quoted comma separated string to a list |
| <p>Handle <a href="https://www.ietf.org/rfc/rfc4180.txt">rfc4180</a>-like |
| CSV strings, with the exceptions:<ul> |
| <li>quoted values may contain double quotes escaped with back-slash |
| <li>Non-quoted values are trimmed of leading trailing white space |
| <li>trailing commas are ignored |
| <li>double commas result in a empty string value |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>list</code> - The Collection to split to (or null to get a new list)</dd> |
| <dd><code>s</code> - The string to parse</dd> |
| <dd><code>off</code> - The offset into the string to start parsing</dd> |
| <dd><code>len</code> - The len in characters to parse</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>list containing the parsed list values</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="sanitizeXmlString(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>sanitizeXmlString</h4> |
| <pre class="methodSignature">public static java.lang.String sanitizeXmlString​(java.lang.String html)</pre> |
| </li> |
| </ul> |
| <a id="strip(java.lang.String,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>strip</h4> |
| <pre class="methodSignature">public static java.lang.String strip​(java.lang.String str, |
| java.lang.String find)</pre> |
| </li> |
| </ul> |
| <a id="valueOf(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>valueOf</h4> |
| <pre class="methodSignature">public static java.lang.String valueOf​(java.lang.Object object)</pre> |
| <div class="block">The String value of an Object |
| <p>This method calls <code>String.valueOf(Object)</code> unless the object is null, |
| in which case null is returned</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>object</code> - The object</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>String value or null</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/StringUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 1995–2021 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |