<b>System</b><br/><pre>global class <b>String</b><br/>extends <a href="psi_element://Object">Object</a><br/></pre><br/>
<span>
<span>
<a name="apex_methods_system_string"><!– –></a><div class="nested0">
<h1 class="helpHead1"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a>String Class</span></h1>



<div class="body">
<div class="shortdesc">Contains methods for the String primitive data type.</div>

<div class="section">
<h2 class="helpHead2">Namespace</h2>
<p class="p"><a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_namespace_System.htm" title="The System namespace provides classes and methods for core Apex functionality.">System</a></p>
</div>

<div class="section">
<h2 class="helpHead2">Usage</h2>
<p class="p">For more information on Strings, see <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/langCon_apex_primitives.htm" title="Apex uses the same primitive data types as the SOAP API. All primitive data types are passed by value.">Primitive Data Types</a>.</p>
</div>

</div>

<div class="topic reference nested1" lang="en-us" lang="en-us" id="apex_System_String_methods">
<a name="apex_System_String_methods"><!– –></a>
<h2 class="helpHead2"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a>String Methods</span></h2>


<div class="body refbody">
<div class="section">
<p class="p">The following are methods for <samp class="codeph apex_code"><span class="keyword">String</span></samp>.</p>
</div>

</div>

<div id="sfdc:seealso" class="related-links">
<ul class="ullinks">
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_abbreviate">abbreviate(maxWidth)</a></strong><br>
Returns an abbreviated version of the String, of the specified length and with ellipses appended if the current String is longer than the specified length; otherwise, returns the original String without ellipses.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_abbreviate_2">abbreviate(maxWidth, offset)</a></strong><br>
Returns an abbreviated version of the String, starting at the specified character offset and of the specified length. The returned String has ellipses appended at the start and the end if characters have been removed at these locations.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_capitalize">capitalize()</a></strong><br>
Returns the current String with the first letter changed to title case.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_center">center(size)</a></strong><br>
Returns a version of the current String of the specified size padded with spaces on the left and right, so that it appears in the center. If the specified size is smaller than the current String size, the entire String is returned without added spaces.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_center_2">center(size, paddingString)</a></strong><br>
Returns a version of the current String of the specified size padded with the specified String on the left and right, so that it appears in the center. If the specified size is smaller than the current String size, the entire String is returned without padding.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_charAt">charAt(index)</a></strong><br>
Returns the value of the character at the specified index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_codePointAt">codePointAt(index)</a></strong><br>
Returns the Unicode code point value at the specified index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_codePointBefore">codePointBefore(index)</a></strong><br>
Returns the Unicode code point value that occurs before the specified index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_codePointCount">codePointCount(beginIndex, endIndex)</a></strong><br>
Returns the number of Unicode code points within the specified text range.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_compareTo">compareTo(secondString)</a></strong><br>
Compares two strings lexicographically, based on the Unicode value of each character in the Strings.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_contains">contains(substring)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if and only if the String that       called the method contains the specified sequence of characters in          <var class="keyword varname">substring</var>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_containsAny">containsAny(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains any of the characters in the specified String; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_containsIgnoreCase">containsIgnoreCase(substring)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains the specified sequence of characters without regard to case; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_containsNone">containsNone(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String doesn’t     contain any of the characters in the specified String; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_containsOnly">containsOnly(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains characters only from the specified sequence of characters and not any other characters; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_containsWhitespace">containsWhitespace()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains any white space characters; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_countMatches">countMatches(substring)</a></strong><br>
Returns the number of times the specified substring occurs in the current String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_deleteWhitespace">deleteWhitespace()</a></strong><br>
Returns a version of the current String with all white space characters removed.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_difference">difference(secondString)</a></strong><br>
Returns the difference between the current String and the specified String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_endsWith">endsWith(suffix)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the String that called the method ends with the specified <var class="keyword varname">suffix</var>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_endsWithIgnoreCase">endsWithIgnoreCase(suffix)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String ends with the specified suffix; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_equals">equals(secondString)</a></strong><br>
Deprecated. This method is replaced by <samp class="codeph apex_code">equals(stringOrId)</samp>. Returns          <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the passed-in string is not null and       represents the same binary sequence of characters as the current string. Use this method to       perform case-sensitive comparisons.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_equals_2">equals(stringOrId)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the          passed-in object is not null and represents the same binary sequence of characters as the          current string. Use this method to compare a string to an object that represents a string          or an ID.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_equalsIgnoreCase">equalsIgnoreCase(secondString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the    <var class="keyword varname">secondString</var> is not null and represents the same sequence of characters as the   String that called the method, ignoring case.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeCsv">escapeCsv()</a></strong><br>
Returns a String for a CSV column enclosed in double quotes, if required.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeEcmaScript">escapeEcmaScript()</a></strong><br>
Escapes the characters in the String using EcmaScript String rules.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeHtml3">escapeHtml3()</a></strong><br>
Escapes the characters in a String using HTML 3.0 entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeHtml4">escapeHtml4()</a></strong><br>
Escapes the characters in a String using HTML 4.0 entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeJava">escapeJava()</a></strong><br>
Returns a String whose characters are escaped using Java String rules. Characters escaped include quotes and control characters, such as tab, backslash, and carriage return characters.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeSingleQuotes">escapeSingleQuotes(stringToEscape)</a></strong><br>
Returns a String with the escape character () added before any single quotation marks in the String <var class="keyword varname">s</var>. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeUnicode">escapeUnicode()</a></strong><br>
Returns a String whose Unicode characters are escaped to a Unicode escape sequence.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_escapeXml">escapeXml()</a></strong><br>
Escapes the characters in a String using XML entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_format">format(stringToFormat, formattingArguments)</a></strong><br>
Treat the current string as a pattern that should be used for substitution in the same manner as <samp class="codeph apex_code">apex:outputText</samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_fromCharArray">fromCharArray(charArray)</a></strong><br>
Returns a String from the values of the list of integers. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_getChars">getChars()</a></strong><br>
Returns an array of character values that represent the characters in this string.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_getCommonPrefix">getCommonPrefix(strings)</a></strong><br>
Returns the initial sequence of characters as a String that is common to all the specified Strings.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_getLevenshteinDistance">getLevenshteinDistance(stringToCompare)</a></strong><br>
Returns the Levenshtein distance between the current String and the specified String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_getLevenshteinDistance_2">getLevenshteinDistance(stringToCompare, threshold)</a></strong><br>
Returns the Levenshtein distance between the current String and the specified String if it is less than or equal than the given threshold; otherwise, returns -1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_hashCode">hashCode()</a></strong><br>
Returns a hash code value for this string. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOf">indexOf(substring)</a></strong><br>
Returns the index of the first occurrence of the specified substring. If the substring does not occur, this method returns -1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOf_2">indexOf(substring, index)</a></strong><br>
Returns the zero-based index of the first occurrence of the specified substring from the point of the given index. If the substring does not occur, this method returns -1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfAny">indexOfAny(substring)</a></strong><br>
Returns the zero-based index of the first occurrence of any character specified in the substring. If none of the characters occur, returns -1. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfAnyBut">indexOfAnyBut(substring)</a></strong><br>
Returns the zero-based index of the first occurrence of a character that is not in the specified substring. Otherwise, returns -1. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfChar">indexOfChar(character)</a></strong><br>
Returns the index of the first occurrence of the character that corresponds to the specified character value.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfChar_2">indexOfChar(character, startIndex)</a></strong><br>
Returns the index of the first occurrence of the character that corresponds to the specified character value, starting from the specified index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfDifference">indexOfDifference(stringToCompare)</a></strong><br>
Returns the zero-based index of the character where the current String begins to differ from the specified String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfIgnoreCase">indexOfIgnoreCase(substring)</a></strong><br>
Returns the zero-based index of the first occurrence of the specified substring without regard to case. If the substring does not occur, this method returns -1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_indexOfIgnoreCase_2">indexOfIgnoreCase(substring, startPosition)</a></strong><br>
Returns the zero-based index of the first occurrence of the specified substring from the point of index <var class="keyword varname">i</var>, without regard to case. If the substring does not occur, this method returns -1. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAllLowerCase">isAllLowerCase()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are lowercase; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAllUpperCase">isAllUpperCase()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are uppercase; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAlpha">isAlpha()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are Unicode letters only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAlphaSpace">isAlphaSpace()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are Unicode letters or spaces only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAlphanumeric">isAlphanumeric()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are Unicode letters or numbers only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAlphanumericSpace">isAlphanumericSpace()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if all characters in the current String are Unicode letters, numbers, or spaces only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isAsciiPrintable">isAsciiPrintable()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains only ASCII printable characters; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isBlank">isBlank(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the specified String is white space, empty (), or null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isEmpty">isEmpty(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the specified String is empty () or null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isNotBlank">isNotBlank(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the specified String is not whitespace, not empty (), and not null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isNotEmpty">isNotEmpty(inputString)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the specified String is not empty () and not null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isNumeric">isNumeric()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains only Unicode digits; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isNumericSpace">isNumericSpace()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains only Unicode digits or spaces; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_isWhitespace">isWhitespace()</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains only     white space characters or is empty; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_join">join(iterableObj, separator)</a></strong><br>
Joins the elements of the specified iterable object, such as a List, into a single String separated by the specified separator.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOf">lastIndexOf(substring)</a></strong><br>
Returns the index of the last occurrence of the specified substring. If the substring does not occur, this method returns -1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOf_2">lastIndexOf(substring, endPosition)</a></strong><br>
Returns the index of the last occurrence of the specified substring, starting from the character at index 0 and ending at the specified index. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOfChar">indexOfChar(character)</a></strong><br>
Returns the index of the last occurrence of the character that corresponds to the specified character value.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOfChar_2">lastIndexOfChar(character, endIndex)</a></strong><br>
Returns the index of the last occurrence of the character that corresponds to the specified character value, starting from the specified index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOfIgnoreCase">lastIndexOfIgnoreCase(substring)</a></strong><br>
Returns the index of the last occurrence of the specified substring regardless of case. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_lastIndexOfIgnoreCase_2">lastIndexOfIgnoreCase(substring, endPosition)</a></strong><br>
Returns the index of the last occurrence of the specified substring regardless of case, starting from the character at index 0 and ending at the specified index. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_left">left(length)</a></strong><br>
Returns the leftmost characters of the current String of the specified length.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_leftPad">leftPad(length)</a></strong><br>
Returns the current String padded with spaces on the left and of the specified length. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_length">length()</a></strong><br>
Returns the number of 16-bit Unicode characters contained in the String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_mid">mid(startIndex, length)</a></strong><br>
Returns a new String that begins with the character at the specified zero-based <var class="keyword varname">startIndex</var> with the number of characters specified by <var class="keyword varname">length</var>. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_normalizeSpace">normalizeSpace()</a></strong><br>
Returns the current String with leading, trailing, and repeating white space characters removed. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_offsetByCodePoints">offsetByCodePoints(index, codePointOffset)</a></strong><br>
Returns the index of the Unicode code point that is offset by the specified number of code points, starting from the given index.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_remove">remove(substring)</a></strong><br>
Removes all occurrences of the specified substring and returns the String result.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_removeEnd">removeEnd(substring)</a></strong><br>
Removes the specified substring only if it occurs at the end of the String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_removeEndIgnoreCase">removeEndIgnoreCase(substring)</a></strong><br>
Removes the specified substring only if it occurs at the end of the String using a case-insensitive match.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_removeStart">removeStart(substring)</a></strong><br>
Removes the specified substring only if it occurs at the beginning of the String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_removeStartIgnoreCase">removeStartIgnoreCase(substring)</a></strong><br>
Removes the specified substring only if it occurs at the beginning of the String using a case-insensitive match.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_repeat">repeat(numberOfTimes)</a></strong><br>
Returns the current String repeated the specified number of times. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_repeat_2">repeat(separator, numberOfTimes)</a></strong><br>
Returns the current String repeated the specified number of times using the specified separator to separate the repeated Strings. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_replace">replace(target, replacement)</a></strong><br>
Replaces each substring of a string that matches the literal target sequence <var class="keyword varname">target</var> with the specified literal replacement sequence <var class="keyword varname">replacement</var>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_replaceAll">replaceAll(regExp, replacement)</a></strong><br>
Replaces each substring of a string that matches the regular expression <var class="keyword varname">regExp</var> with the replacement sequence <var class="keyword varname">replacement</var>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_replaceFirst">replaceFirst(regExp, replacement)</a></strong><br>
Replaces the first substring of a string that matches the regular expression <var class="keyword varname">regExp</var> with the replacement sequence <var class="keyword varname">replacement</var>. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_reverse">reverse()</a></strong><br>
Returns a String with all the characters reversed.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_right">right(length)</a></strong><br>
Returns the rightmost characters of the current String of the specified length.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_rightPad">rightPad(length)</a></strong><br>
Returns the current String padded with spaces on the right and of the specified length. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_split">split(regExp)</a></strong><br>
Returns a list that contains each substring of                                 the String that is terminated by either the regular expression                                 <var class="keyword varname">regExp</var> or the end of the String.         </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_split_2">split(regExp, limit)</a></strong><br>
Returns a list that contains each substring of                                 the String that is terminated by either the regular expression                                 <var class="keyword varname">regExp</var> or the end of the String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_splitByCharacterType">splitByCharacterType()</a></strong><br>
Splits the current String by character type and returns a list of contiguous character groups of the same type as complete tokens.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_splitByCharacterTypeCamelCase">splitByCharacterTypeCamelCase()</a></strong><br>
Splits the current String by character type and returns a list of contiguous character groups of the same type as complete tokens, with the following exception: the uppercase character, if any, immediately preceding a lowercase character token belongs to the following character token rather than to the preceding.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_startsWith">startsWith(prefix)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the String that called the method begins with the specified <var class="keyword varname">prefix</var>.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_startsWithIgnoreCase">startsWithIgnoreCase(prefix)</a></strong><br>
Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String begins with the specified prefix regardless of the prefix case.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_stripHtmlTags">stripHtmlTags(htmlInput)</a></strong><br>
Removes HTML markup from the input string and returns the plain text.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substring">substring(startIndex)</a></strong><br>
Returns a new String that begins with the character at the specified zero-based <var class="keyword varname">startIndex</var> and extends to the end of the String. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substring_2">substring(startIndex, endIndex)</a></strong><br>
Returns a new String that begins with the character at the specified zero-based <var class="keyword varname">startIndex</var> and extends to the character at <var class="keyword varname">endIndex</var> - 1.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringAfter">substringAfter(separator)</a></strong><br>
Returns the substring that occurs after the first occurrence of the specified separator.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringAfterLast">substringAfterLast(separator)</a></strong><br>
Returns the substring that occurs after the last occurrence of the specified separator.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringBefore">substringBefore(separator)</a></strong><br>
Returns the substring that occurs before the first occurrence of the specified separator.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringBeforeLast">substringBeforeLast(separator)</a></strong><br>
Returns the substring that occurs before the last occurrence of the specified separator.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringBetween">substringBetween(tag)</a></strong><br>
Returns the substring that occurs between two instances of the specified          <var class="keyword varname">tag</var> String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_substringBetween_2">substringBetween(open, close)</a></strong><br>
Returns the substring that occurs between the two specified Strings.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_swapCase">swapCase()</a></strong><br>
Swaps the case of all characters and returns the resulting String by using the default   (English US) locale. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toLowerCase">toLowerCase()</a></strong><br>
Converts all of the characters in the String to lowercase using the rules of the default     (English US) locale.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toLowerCase_2">toLowerCase(locale)</a></strong><br>
Converts all of the characters in the String to lowercase using the rules of the specified locale.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toUpperCase">toUpperCase()</a></strong><br>
Converts all of the characters in the String to uppercase using the rules of the default       (English US) locale.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_toUpperCase_2">toUpperCase(locale)</a></strong><br>
Converts all of the characters in the String to the uppercase using the rules of the specified locale. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_trim">trim()</a></strong><br>
Returns a copy of the string that no longer contains any leading or trailing white space characters. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_uncapitalize">uncapitalize()</a></strong><br>
Returns the current String with the first letter in lowercase.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeCsv">unescapeCsv()</a></strong><br>
Returns a String representing an unescaped CSV column.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeEcmaScript">unescapeEcmaScript()</a></strong><br>
Unescapes any EcmaScript literals found in the String.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeHtml3">unescapeHtml3()</a></strong><br>
Unescapes the characters in a String using HTML 3.0 entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeHtml4">unescapeHtml4()</a></strong><br>
Unescapes the characters in a String using HTML 4.0 entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeJava">unescapeJava()</a></strong><br>
Returns a String whose Java literals are unescaped. Literals unescaped include escape sequences for quotes (\\") and control characters, such as tab (\\t), and carriage return (\\n).</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeUnicode">unescapeUnicode()</a></strong><br>
Returns a String whose escaped Unicode characters are unescaped.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_unescapeXml">unescapeXml()</a></strong><br>
Unescapes the characters in a String using XML entities.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf">valueOf(dateToConvert)</a></strong><br>
Returns a String that represents the specified Date in the standard “yyyy-MM-dd” format.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_2">valueOf(datetimeToConvert)</a></strong><br>
Returns a String that represents the specified Datetime in the standard “yyyy-MM-dd HH:mm:ss” format for the local time zone.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_3">valueOf(decimalToConvert)</a></strong><br>
Returns a String that represents the specified Decimal.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_4">valueOf(doubleToConvert)</a></strong><br>
Returns a String that represents the specified Double.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_5">valueOf(integerToConvert)</a></strong><br>
Returns a String that represents the specified Integer.</li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_6">valueOf(longToConvert)</a></strong><br>
Returns a String that represents the specified Long. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_7">valueOf(toConvert)</a></strong><br>
Returns a string representation of the specified object argument. </li>
<li class="link ulchildlink">
<strong><a href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOfGmt">valueOfGmt(datetimeToConvert)</a></strong><br>
Returns a String that represents the specified Datetime in the standard “yyyy-MM-dd HH:mm:ss” format for the GMT time zone.</li>
</ul>
</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_abbreviate">
<a name="apex_System_String_abbreviate"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">abbreviate(maxWidth)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns an abbreviated version of the String, of the specified
length and with ellipses appended if the current String is longer
than the specified length; otherwise, returns the original String
without ellipses.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> abbreviate(<span class="keyword">Integer</span> maxWidth)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">maxWidth</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">If <var class="keyword varname">maxWidth</var> is less than four, this method
throws a run-time exception.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Maximillian'</span>;
<span class="keyword">String</span> s2 = s.abbreviate(8);
System.assertEquals(<span class="string">'Hello...'</span>, s2);
System.assertEquals(8, s2.length());</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_abbreviate_2">
<a name="apex_System_String_abbreviate_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">abbreviate(maxWidth, offset)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns an abbreviated version of the String, starting
at the specified character offset and of the specified length. The
returned String has ellipses appended at the start and the end if
characters have been removed at these locations.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> abbreviate(<span class="keyword">Integer</span> maxWidth,
<span class="keyword">Integer</span> offset)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">maxWidth</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">Note that the offset is not necessarily the leftmost character
in the returned String or the first character following the ellipses,
but it appears somewhere in the result.  Regardless, <samp class="codeph apex_code">abbreviate</samp> won’t return a
String of length greater than <var class="keyword varname">maxWidth</var>.If <var class="keyword varname">maxWidth</var> is too small, this method throws a run-time exception.</dd>



<dt class="dt dlterm"><var class="keyword varname">offset</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Maximillian'</span>;
<span class="onelineComment">// Start at M</span>
<span class="keyword">String</span> s2 = s.abbreviate(9,6);
System.assertEquals(<span class="string">'...Max...'</span>, s2);
System.assertEquals(9, s2.length());</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_capitalize">
<a name="apex_System_String_capitalize"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">capitalize()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String with the first letter changed
to title case.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> capitalize()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">This method is based on the <a class="xref" href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true#toTitleCase%28char%29" target="_blank" title="HTML (New Window)"><samp class="codeph nolang">Character.toTitleCase(char)</samp></a> Java method.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'hello maximillian'</span>;
<span class="keyword">String</span> s2 = s.capitalize();
System.assertEquals(<span class="string">'Hello maximillian'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_center">
<a name="apex_System_String_center"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">center(size)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a version of the current String of the specified
size padded with spaces on the left and right, so that it appears
in the center. If the specified size is smaller than the current String
size, the entire String is returned without added spaces.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> center(<span class="keyword">Integer</span> size)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">size</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'hello'</span>;
<span class="keyword">String</span> s2 = s.center(9);
System.assertEquals(
   <span class="string">'  hello  '</span>,
   s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_center_2">
<a name="apex_System_String_center_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">center(size, paddingString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a version of the current String of the specified
size padded with the specified String on the left and right, so that
it appears in the center. If the specified size is smaller than the
current String size, the entire String is returned without padding.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> center(<span class="keyword">Integer</span> size, <span class="keyword">String</span>
    paddingString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">size</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">paddingString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'hello'</span>;
<span class="keyword">String</span> s2 = s.center(9, <span class="string">'-'</span>);
System.assertEquals(<span class="string">'hello'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_charAt">
<a name="apex_System_String_charAt"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">charAt(index)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the value of the character at
the specified index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> charAt(<span class="keyword">Integer</span> index)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">index</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index of the character to get the value of.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The integer value of the character.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The <samp class="codeph apex_code">charAt</samp> method returns the value of
the character pointed to by the specified index. If the index points
to the beginning of a surrogate pair (the high-surrogate code point),
this method returns only the high-surrogate code point. To return
the supplementary code point corresponding to a surrogate pair, call <samp class="codeph apex_code">codePointAt</samp> instead.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example gets the value of the
first character at index 0.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'Ω is Omega.'</span>;
System.assertEquals(937, str.charAt(0));</pre></div>
<p class="p">This example
shows the difference between <samp class="codeph apex_code">charAt</samp> and <samp class="codeph apex_code">codePointAt</samp>. The example
calls these methods on escaped supplementary Unicode characters. <samp class="codeph apex_code">charAt(0)</samp> returns the high surrogate
value, which corresponds to <span class="keyword parmname">\uD835</span>. <samp class="codeph apex_code">codePointAt(0)</samp> returns the value for
the entire surrogate pair.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\uD835\uDD0A'</span>;
System.assertEquals(55349, str.charAt(0),
    <span class="string">'charAt(0) didn\'t return the high surrogate.'</span>);
System.assertEquals(120074, str.codePointAt(0),
    <span class="string">'codePointAt(0) didn\'t return the entire two-character supplementary value.'</span>);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_codePointAt">
<a name="apex_System_String_codePointAt"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">codePointAt(index)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the Unicode code point value
at the specified index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> codePointAt(<span class="keyword">Integer</span> index)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">index</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index of the characters (Unicode code units) in the string.
The index range is from zero to the string length minus one.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The Unicode code point value at the specified index.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the <var class="keyword varname">index</var> points to the beginning of a surrogate pair (the high-surrogate
code point), and the character value at the following index points
to the low-surrogate code point, this method returns the supplementary
code point corresponding to this surrogate pair. Otherwise, this method
returns the character value at the given index.</p>
<p class="p">For more information
on Unicode and surrogate pairs, see <a class="xref" href="http://www.unicode.org" target="_blank" title="HTML (New Window)">The Unicode Consortium</a>.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example gets the code point
value of the first character at index 0, which is the escaped Omega
character. Also, the example gets the code point at index 20, which
corresponds to the escaped supplementary Unicode characters (a pair
of characters). Finally, it verifies that the escaped and unescaped
forms of Omega have the same code point values.</p>
<p class="p">The supplementary
characters in this example (<span class="keyword parmname">\\uD835\\uDD0A</span>) correspond
to mathematical fraktur capital G: <img class="image" src="/docs/resources/img/en-us/202.0?doc_id=dev_guides%2Fapex%2Fimages%2FfrakturG.png&folder=apexcode" alt="Mathemtical Fraktur Capital G symbol"></p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\u03A9 is Ω (Omega), and \uD835\uDD0A '</span> +
    <span class="string">' is Fraktur Capital G.'</span>;
System.assertEquals(937, str.codePointAt(0));
System.assertEquals(120074, str.codePointAt(20));
<span class="onelineComment">// Escaped or unescaped forms of the same character have the same code point</span>
System.assertEquals(str.codePointAt(0), str.codePointAt(5));
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_codePointBefore">
<a name="apex_System_String_codePointBefore"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">codePointBefore(index)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the Unicode code point value
that occurs before the specified index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> codePointBefore(<span class="keyword">Integer</span> index)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">index</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index before the Unicode code point that is to be returned.
The index range is from one to the string length.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The character or Unicode code point value that occurs before the
specified index.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the character value at <samp class="codeph nolang"><var class="keyword varname">index</var>-1</samp> is the low-surrogate
code point, and <samp class="codeph nolang"><var class="keyword varname">index</var>-2</samp> is not negative and the character at this index location
is the high-surrogate code point, this method returns the supplementary
code point corresponding to this surrogate pair. If the character
value at <samp class="codeph nolang"><var class="keyword varname">index</var>-1</samp> is an unpaired low-surrogate or high-surrogate code point, the surrogate
value is returned.</p>
<p class="p">For more information on Unicode and surrogate
pairs, see <a class="xref" href="http://www.unicode.org" target="_blank" title="HTML (New Window)">The Unicode Consortium</a>.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example gets the code point
value of the first character (before index 1), which is the escaped
Omega character. Also, the example gets the code point at index 20,
which corresponds to the escaped supplementary characters (the two
characters before index 22).</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\u03A9 is Ω (Omega), and \uD835\uDD0A '</span> +
    <span class="string">' is Fraktur Capital G.'</span>;
System.assertEquals(937, str.codePointBefore(1));
System.assertEquals(120074, str.codePointBefore(22));</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_codePointCount">
<a name="apex_System_String_codePointCount"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">codePointCount(beginIndex, endIndex)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the number of Unicode code points
within the specified text range.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> codePointCount(<span class="keyword">Integer</span> beginIndex,
<span class="keyword">Integer</span> endIndex)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">beginIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index of the first character in the range.</dd>



<dt class="dt dlterm"><var class="keyword varname">endIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index after the last character in the range.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The number of Unicode code points within the specified range.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The specified range begins
at <var class="keyword varname">beginIndex</var> and ends at <samp class="codeph nolang"><var class="keyword varname">endIndex</var>—1</samp>. Unpaired surrogates
within the text range count as one code point each.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example writes the count of
code points in a substring that contains an escaped Unicode character
and another substring that contains Unicode supplementary characters,
which count as one code point.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\u03A9 and \uD835\uDD0A characters.'</span>;
System.debug(<span class="string">'Count of code points for '</span> + str.substring(0,1)
             + <span class="string">': '</span> + str.codePointCount(0,1));
System.debug(<span class="string">'Count of code points for '</span> + str.substring(6,8)
             + <span class="string">': '</span> + str.codePointCount(6,8));

<span class="onelineComment">// Output:</span>
<span class="onelineComment">// Count of code points for Ω: 1</span>
<span class="onelineComment">// Count of code points for 𝔊: 1</span></pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_compareTo">
<a name="apex_System_String_compareTo"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">compareTo(secondString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Compares two strings lexicographically, based on the Unicode
value of each character in the Strings.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> compareTo(<span class="keyword">String</span> secondString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">secondString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p"> The result is:</p>
<ul class="ul bulletList">
<li class="li">A negative Integer if the String that called the method lexicographically precedes
                  <var class="keyword varname">secondString</var>
</li>

<li class="li">A positive Integer if the String that called the method lexicographically follows
                  <var class="keyword varname">compsecondStringString</var>
</li>

<li class="li">Zero if the Strings are equal</li>

</ul>
<p class="p">If there is no index position at which the Strings differ,
then the shorter String lexicographically precedes the longer String. </p>
<p class="p">Note that this method returns 0 whenever the <samp class="codeph apex_code">equals</samp> method returns true.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcde'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'abcd'</span>;
<span class="keyword">Integer</span> result =
   myString1.compareTo(myString2);
System.assertEquals(result, 1);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_contains">
<a name="apex_System_String_contains"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">contains(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if and only if the String that
      called the method contains the specified sequence of characters in
         <var class="keyword varname">substring</var>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> contains(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcde'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'abcd'</span>;
<span class="keyword">Boolean</span> result =
   myString1.contains(myString2);
System.assertEquals(result, <span class="keyword">true</span>);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_containsAny">
<a name="apex_System_String_containsAny"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">containsAny(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains any of the characters in the specified
String; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> containsAny(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'hello'</span>;
<span class="keyword">Boolean</span> b1 = s.containsAny(<span class="string">'hx'</span>);
<span class="keyword">Boolean</span> b2 = s.containsAny(<span class="string">'x'</span>);
System.assertEquals(<span class="keyword">true</span>, b1);
System.assertEquals(<span class="keyword">false</span>, b2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_containsIgnoreCase">
<a name="apex_System_String_containsIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">containsIgnoreCase(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains the specified sequence of characters without
regard to case; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> containsIgnoreCase(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'hello'</span>;
<span class="keyword">Boolean</span> b = s.containsIgnoreCase(<span class="string">'HE'</span>);
System.assertEquals(
   <span class="keyword">true</span>,
   b);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_containsNone">
<a name="apex_System_String_containsNone"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">containsNone(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String doesn’t
    contain any of the characters in the specified String; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> containsNone(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>

<dd class="dd">If <var class="keyword varname">inputString</var> is an empty string or the current String is empty, this method
            returns <samp class="codeph apex_code"><span class="keyword">true</span></samp>. If <var class="keyword varname">inputString</var>
            is null, this method returns a run-time exception.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcde'</span>;
System.assert(s1.containsNone(<span class="string">'fg'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_containsOnly">
<a name="apex_System_String_containsOnly"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">containsOnly(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains characters only from the specified sequence
of characters and not any other characters; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> containsOnly(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abba'</span>;
<span class="keyword">String</span> s2 = <span class="string">'abba xyz'</span>;
<span class="keyword">Boolean</span> b1 =
   s1.containsOnly(<span class="string">'abcd'</span>);
System.assertEquals(
   <span class="keyword">true</span>,
   b1);
<span class="keyword">Boolean</span> b2 =
   s2.containsOnly(<span class="string">'abcd'</span>);
System.assertEquals(
   <span class="keyword">false</span>,
   b2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_containsWhitespace">
<a name="apex_System_String_containsWhitespace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">containsWhitespace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains any white space characters; otherwise,
returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> containsWhitespace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jane'</span>;
System.assert(s.containsWhitespace()); <span class="onelineComment">//true</span>
s = <span class="string">'HelloJane '</span>;
System.assert(s.containsWhitespace()); <span class="onelineComment">//true</span>
s = <span class="string">' HelloJane'</span>;
System.assert(s.containsWhitespace()); <span class="onelineComment">//true</span>
s = <span class="string">'HelloJane'</span>;
System.assert(!s.containsWhitespace()); <span class="onelineComment">//false</span></pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_countMatches">
<a name="apex_System_String_countMatches"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">countMatches(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the number of times the specified substring occurs
in the current String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> countMatches(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jane'</span>;
System.assertEquals(1, s.countMatches(<span class="string">'Hello'</span>));
s = <span class="string">'Hello Hello'</span>;
System.assertEquals(2, s.countMatches(<span class="string">'Hello'</span>));
s = <span class="string">'Hello hello'</span>;
System.assertEquals(1, s.countMatches(<span class="string">'Hello'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_deleteWhitespace">
<a name="apex_System_String_deleteWhitespace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">deleteWhitespace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a version of the current String with all white
space characters removed.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> deleteWhitespace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">' Hello Jane '</span>;
<span class="keyword">String</span> s2 = <span class="string">'HelloJane'</span>;
System.assertEquals(s2, s1.deleteWhitespace());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_difference">
<a name="apex_System_String_difference"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">difference(secondString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the difference between the current String and the
specified String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> difference(<span class="keyword">String</span> secondString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">secondString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>

<dd class="dd">If <var class="keyword varname">secondString</var> is an empty string, this method returns an empty string.If
                     <var class="keyword varname">secondString</var> is null, this method throws a run-time
                  exception.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jane'</span>;
<span class="keyword">String</span> d1 =
   s.difference(<span class="string">'Hello Max'</span>);
System.assertEquals(
   <span class="string">'Max'</span>,
   d1);
<span class="keyword">String</span> d2 =
   s.difference(<span class="string">'Goodbye'</span>);
System.assertEquals(
   <span class="string">'Goodbye'</span>,
   d2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_endsWith">
<a name="apex_System_String_endsWith"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">endsWith(suffix)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the String that called the method ends with the specified <var class="keyword varname">suffix</var>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> endsWith(<span class="keyword">String</span> suffix)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">suffix</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jason'</span>;
System.assert(s.endsWith(<span class="string">'Jason'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_endsWithIgnoreCase">
<a name="apex_System_String_endsWithIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">endsWithIgnoreCase(suffix)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String ends with the specified suffix; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> endsWithIgnoreCase(<span class="keyword">String</span> suffix)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">suffix</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jason'</span>;
System.assert(s.endsWithIgnoreCase(<span class="string">'jason'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_equals">
<a name="apex_System_String_equals"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">equals(secondString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Deprecated. This method is replaced by <samp class="codeph apex_code">equals(stringOrId)</samp>. Returns
         <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the passed-in string is not null and
      represents the same binary sequence of characters as the current string. Use this method to
      perform case-sensitive comparisons.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> equals(<span class="keyword">String</span> secondString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">secondString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>

         <p class="p">This method returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> when the <samp class="codeph apex_code">compareTo</samp> method returns 0.</p>
<p class="p"><span class="ph" id="equals_note"><a name="equals_note"><!– –></a>Use this method to perform case-sensitive comparisons. In contrast, the
                  <samp class="codeph apex_code">==</samp> operator performs case-insensitive
               string comparisons to match Apex
               semantics.</span></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcde'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'abcd'</span>;
<span class="keyword">Boolean</span> result = myString1.equals(myString2);
System.assertEquals(result, <span class="keyword">false</span>);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_equals_2">
<a name="apex_System_String_equals_2"><!– –></a>
   <h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">equals(stringOrId)</span></span></h3>



   <div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the
         passed-in object is not null and represents the same binary sequence of characters as the
         current string. Use this method to compare a string to an object that represents a string
         or an ID.</span></div>

      <div class="section">
<h4 class="helpHead4">Signature</h4>


         <p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> equals(<span class="keyword">Object</span> stringOrId)</samp></p>


      </div>

      <div class="section">
<h4 class="helpHead4">Parameters</h4>


         <dl class="dl detailList">

               <dt class="dt dlterm"><var class="keyword varname">stringOrId</var></dt>

               <dd class="dd">Type: Object</dd>


         </dl>

      </div>

      <div class="section">
<h4 class="helpHead4">Return Value</h4>


         <p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>

      </div>

      <div class="section">
<h4 class="helpHead4">Usage</h4>


         <p class="p">If you compare ID values, the lengths of IDs don’t need to be equal. For example, if you
            compare a 15-character ID string to an object that represents the equivalent
            18-character ID value, this method returns <samp class="codeph apex_code"><span class="keyword">true</span></samp>.
            For more information about 15-character and 18-character IDs, see the <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/langCon_apex_primitives.htm#id_type">ID data type</a>.</p>

         <p class="p">Use this method to perform case-sensitive comparisons. In contrast, the
                  <samp class="codeph apex_code">==</samp> operator performs case-insensitive
               string comparisons to match Apex
               semantics.</p>

      </div>

      <div class="section">
<h4 class="helpHead4">Example</h4>


         <p class="p">These examples show comparisons between different types of variables with both equal and
            unequal values. The examples also show how Apex automatically
            converts certain values before comparing them. </p>

         <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Compare a string to an object containing a string</span>
<span class="keyword">Object</span> obj1 = <span class="string">'abc'</span>;
<span class="keyword">String</span> str = <span class="string">'abc'</span>;
<span class="keyword">Boolean</span> result1 = str.equals(obj1);
System.assertEquals(<span class="keyword">true</span>, result1);

<span class="onelineComment">// Compare a string to an object containing a number</span>
<span class="keyword">Integer</span> obj2 = 100;
<span class="keyword">Boolean</span> result2 = str.equals(obj2);
System.assertEquals(<span class="keyword">false</span>, result2);

<span class="onelineComment">// Compare a string to an ID of the same length.</span>
<span class="onelineComment">// 15-character ID</span>
Id idValue15 = <span class="string">'001D000000Ju1zH'</span>;
<span class="onelineComment">// 15-character ID string value</span>
<span class="keyword">String</span> stringValue15 = <span class="string">'001D000000Ju1zH'</span>;
<span class="keyword">Boolean</span> result3 = stringValue15.equals(IdValue15);
System.assertEquals(<span class="keyword">true</span>, result3);

<span class="onelineComment">// Compare two equal ID values of different lengths:</span>
<span class="onelineComment">//  15-character ID and 18-character ID</span>
Id idValue18 = <span class="string">'001D000000Ju1zHIAR'</span>;
<span class="keyword">Boolean</span> result4 = stringValue15.equals(IdValue18);
System.assertEquals(<span class="keyword">true</span>, result4);
</pre></div>

      </div>

   </div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_equalsIgnoreCase">
<a name="apex_System_String_equalsIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">equalsIgnoreCase(secondString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the
   <var class="keyword varname">secondString</var> is not null and represents the same sequence of characters as the
  String that called the method, ignoring case.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> equalsIgnoreCase(<span class="keyword">String</span> secondString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">secondString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'ABCD'</span>;
<span class="keyword">Boolean</span> result =
myString1.equalsIgnoreCase(myString2);
System.assertEquals(result, <span class="keyword">true</span>);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeCsv">
<a name="apex_System_String_escapeCsv"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeCsv()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String for a CSV column enclosed in double quotes,
if required.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeCsv()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the String contains a
comma, newline or double quote, the returned String is enclosed in
double quotes. Also, any double quote characters in the String are
escaped with another double quote.</p>
<p class="p">If the String doesn’t
contain a comma, newline or double quote, it is returned unchanged.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Max1, "Max2"'</span>;
<span class="keyword">String</span> s2 = s1.escapeCsv();
System.assertEquals(<span class="string">'"Max1, ""Max2"""'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeEcmaScript">
<a name="apex_System_String_escapeEcmaScript"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeEcmaScript()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Escapes the characters in the String using EcmaScript String
rules.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeEcmaScript()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>


      <p class="p">The only difference between Apex strings and
        EcmaScript strings is that in EcmaScript, a single quote and forward-slash (/) are
        escaped.</p>

    </div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'"grade": 3.9/4.0'</span>;
<span class="keyword">String</span> s2 = s1.escapeEcmaScript();
System.debug(s2);
<span class="onelineComment">// Output is:</span>
<span class="onelineComment">// \"grade\": 3.9\/4.0</span>
System.assertEquals(
   <span class="string">'\\"grade\\": 3.9\\/4.0'</span>,
    s2);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeHtml3">
<a name="apex_System_String_escapeHtml3"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeHtml3()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Escapes the characters in a String using HTML 3.0 entities.</div>

      <div class="section">
<h4 class="helpHead4">Signature</h4>


         <p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeHtml3()</samp></p>


      </div>

      <div class="section">
<h4 class="helpHead4">Return Value</h4>


         <p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>

      </div>

      <div class="section">
<h4 class="helpHead4">Example</h4>


         <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>;
<span class="keyword">String</span> s2 =
   s1.escapeHtml3();
System.debug(s2);
<span class="onelineComment">// Output:</span>
<span class="onelineComment">// &amp;quot;&amp;lt;Black&amp;amp;</span>
<span class="onelineComment">// White&amp;gt;&amp;quot;</span></pre></div>

      </div>

   </div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeHtml4">
<a name="apex_System_String_escapeHtml4"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeHtml4()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Escapes the characters in a String using HTML 4.0 entities.</div>

      <div class="section">
<h4 class="helpHead4">Signature</h4>


         <p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeHtml4()</samp></p>


      </div>

      <div class="section">
<h4 class="helpHead4">Return Value</h4>


         <p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>

      </div>

      <div class="section">
<h4 class="helpHead4">Example</h4>


         <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>;
<span class="keyword">String</span> s2 =
   s1.escapeHtml4();
System.debug(s2);
<span class="onelineComment">// Output:</span>
<span class="onelineComment">// &amp;quot;&amp;lt;Black&amp;amp;</span>
<span class="onelineComment">// White&amp;gt;&amp;quot;</span></pre></div>

      </div>

   </div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeJava">
<a name="apex_System_String_escapeJava"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeJava()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String whose characters are escaped using Java
String rules. Characters escaped include quotes and control characters,
such as tab, backslash, and carriage return characters.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeJava()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
<p class="p">The escaped string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Input string contains quotation marks</span>
<span class="keyword">String</span> s = <span class="string">'Company: "Salesforce.com"'</span>;
<span class="keyword">String</span> escapedStr = s.escapeJava();
<span class="onelineComment">// Output string has the quotes escpaded</span>
System.assertEquals(<span class="string">'Company: \\"Salesforce.com\\"'</span>, escapedStr);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeSingleQuotes">
<a name="apex_System_String_escapeSingleQuotes"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeSingleQuotes(stringToEscape)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String with the escape character () added before
any single quotation marks in the String <var class="keyword varname">s</var>. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> escapeSingleQuotes(<span class="keyword">String</span>
stringToEscape)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">stringToEscape</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">This method is useful when creating
a dynamic SOQL statement, to help prevent SOQL injection. For more
information on dynamic SOQL, see <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_dynamic_soql.htm">Dynamic SOQL</a>.</p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'\'Hello Jason\</span>;
system.debug(s); <span class="onelineComment">// Outputs 'Hello Jason'</span>
<span class="keyword">String</span> escapedStr = <span class="keyword">String</span>.escapeSingleQuotes(s);
<span class="onelineComment">// Outputs \'Hello Jason\'</span>
system.debug(escapedStr);
<span class="onelineComment">// Escapes the string \\\' to string \'</span>
system.assertEquals(<span class="string">'\\\'Hello Jason\\\</span>, escapedStr); </pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeUnicode">
<a name="apex_System_String_escapeUnicode"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeUnicode()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String whose Unicode characters are escaped to
a Unicode escape sequence.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeUnicode()</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
<p class="p">The escaped string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'De onde você é?'</span>;
<span class="keyword">String</span> escapedStr = s.escapeUnicode();
System.assertEquals(<span class="string">'De onde voc\\u00EA \\u00E9?'</span>, escapedStr);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_escapeXml">
<a name="apex_System_String_escapeXml"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">escapeXml()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Escapes the characters in a String using XML entities.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> escapeXml()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">Supports only the five basic
XML entities (gt, lt, quot, amp, apos). Does not support DTDs or external
entities. Unicode characters greater than 0x7f are not escaped.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>;
<span class="keyword">String</span> s2 =
   s1.escapeXml();
System.debug(s2);
<span class="onelineComment">// Output:</span>
<span class="onelineComment">// &amp;quot;&amp;lt;Black&amp;amp;</span>
<span class="onelineComment">// White&amp;gt;&amp;quot;</span></pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_format">
<a name="apex_System_String_format"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">format(stringToFormat, formattingArguments)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Treat the current string as a pattern that should be used
for substitution in the same manner as <samp class="codeph apex_code">apex:outputText</samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> format(<span class="keyword">String</span> stringToFormat,
List&lt;<span class="keyword">String</span>&gt; formattingArguments)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">stringToFormat</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">formattingArguments</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>&gt;</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> placeholder = <span class="string">'Hello {0}, {1} is cool!'</span>;
List&lt;<span class="keyword">String</span>&gt; fillers = <span class="keyword">new</span> <span class="keyword">String</span>[]{<span class="string">'Jason'</span>,<span class="string">'Apex'</span>};
<span class="keyword">String</span> formatted = <span class="keyword">String</span>.format(placeholder, fillers);
System.assertEquals(<span class="string">'Hello Jason, Apex is cool!'</span>, formatted);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_fromCharArray">
<a name="apex_System_String_fromCharArray"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">fromCharArray(charArray)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String from the values of the list of integers. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> fromCharArray(List&lt;<span class="keyword">Integer</span>&gt;
charArray)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">charArray</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>&gt;</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex">List&lt;<span class="keyword">Integer</span>&gt; charArr= <span class="keyword">new</span> <span class="keyword">Integer</span>[]{74};
<span class="keyword">String</span> convertedChar = <span class="keyword">String</span>.fromCharArray(charArr);
System.assertEquals(<span class="string">'J'</span>, convertedChar);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_getChars">
<a name="apex_System_String_getChars"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">getChars()</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns an array of character values
that represent the characters in this string.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> List&lt;<span class="keyword">Integer</span>&gt; getChars()</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>&gt;</p>
<p class="p">A list of integers, each corresponding to a character value in the
string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This sample converts a string to
a character array and then gets the first array element, which corresponds
to the value of 'J'.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'Jane goes fishing.'</span>;
<span class="keyword">Integer</span>[] chars = str.getChars();
<span class="onelineComment">// Get the value of 'J'</span>
System.assertEquals(74, chars[0]);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_getCommonPrefix">
<a name="apex_System_String_getCommonPrefix"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">getCommonPrefix(strings)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the initial sequence of characters as a String
that is common to all the specified Strings.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> getCommonPrefix(List&lt;<span class="keyword">String</span>&gt;
strings)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">strings</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>&gt;</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex">List&lt;<span class="keyword">String</span>&gt; ls = <span class="keyword">new</span> List&lt;<span class="keyword">String</span>&gt;{<span class="string">'SFDCApex'</span>, <span class="string">'SFDCVisualforce'</span>};
<span class="keyword">String</span> prefix = <span class="keyword">String</span>.getCommonPrefix(ls);
System.assertEquals(<span class="string">'SFDC'</span>, prefix);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_getLevenshteinDistance">
<a name="apex_System_String_getLevenshteinDistance"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">getLevenshteinDistance(stringToCompare)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the Levenshtein distance between the current String
and the specified String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> getLevenshteinDistance(<span class="keyword">String</span>
stringToCompare)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">stringToCompare</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The Levenshtein distance
is the number of changes needed to change one String into another.
Each change is a single character modification (deletion, insertion
or substitution).</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Joe'</span>;
<span class="keyword">Integer</span> i = s.getLevenshteinDistance(<span class="string">'Hello Max'</span>);
System.assertEquals(3, i);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_getLevenshteinDistance_2">
<a name="apex_System_String_getLevenshteinDistance_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">getLevenshteinDistance(stringToCompare, threshold)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the Levenshtein distance between the current String
and the specified String if it is less than or equal than the given
threshold; otherwise, returns -1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> getLevenshteinDistance(<span class="keyword">String</span>
stringToCompare, <span class="keyword">Integer</span> threshold)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">stringToCompare</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">threshold</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The Levenshtein distance
is the number of changes needed to change one String into another.
Each change is a single character modification (deletion, insertion
or substitution).</p>
<p class="p">Example:</p>
<p class="p">In this example, the Levenshtein
distance is 3, but the threshold argument is 2, which is less than
the distance, so this method returns -1.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Hello Jane'</span>;
<span class="keyword">Integer</span> i = s.getLevenshteinDistance(<span class="string">'Hello Max'</span>, 2);
System.assertEquals(-1, i);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_hashCode">
<a name="apex_System_String_hashCode"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">hashCode()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a hash code value for this string. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> hashCode()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">This value is based on the
hash code computed by the Java <a class="xref" href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#hashCode%28%29" target="_blank" title="HTML (New Window)"><samp class="codeph nolang">String.hashCode</samp></a> counterpart method.</p>
<p class="p">You can
use this method to simplify the computation of a hash code for a custom
type that contains String member variables. You can compute your type’s
hash code value based on the hash code of each String variable. For
example:</p>
<p class="p">For more details about the use of hash code methods
with custom types, see <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/langCon_apex_collections_maps_keys_userdefined.htm" title="You can add instances of your own Apex classes to maps and sets.">Using Custom Types in Map Keys and Sets</a>.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">public</span> <span class="keyword">class</span> MyCustomClass {
   <span class="keyword">String</span> x,y;
   <span class="onelineComment">// Provide a custom hash code</span>
   <span class="keyword">public</span> <span class="keyword">Integer</span> hashCode() {
    <span class="statement">return</span>
    (31*x.hashCode())^(y.hashCode());
   }
}</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOf">
<a name="apex_System_String_indexOf"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOf(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the index of the first occurrence of the specified
substring. If the substring does not occur, this method returns -1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOf(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcde'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'cd'</span>;
<span class="keyword">Integer</span> result = myString1.indexOf(mystring2);
System.assertEquals(2, result);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOf_2">
<a name="apex_System_String_indexOf_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOf(substring, index)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the first occurrence of
the specified substring from the point of the given index. If the
substring does not occur, this method returns -1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOf(<span class="keyword">String</span> substring, <span class="keyword">Integer</span>
index)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">index</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcdabcd'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'ab'</span>;
<span class="keyword">Integer</span> result = myString1.indexOf(mystring2, 1);
System.assertEquals(4, result);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfAny">
<a name="apex_System_String_indexOfAny"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfAny(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the first occurrence of
any character specified in the substring. If none of the characters
occur, returns -1. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfAny(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> s2 = <span class="string">'xc'</span>;
<span class="keyword">Integer</span> result = s1.indexOfAny(s2);
System.assertEquals(2, result);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfAnyBut">
<a name="apex_System_String_indexOfAnyBut"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfAnyBut(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the first occurrence of
a character that is not in the specified substring. Otherwise, returns
1. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfAnyBut(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> s2 = <span class="string">'xc'</span>;
<span class="keyword">Integer</span> result = s1.indexOfAnyBut(s2);
System.assertEquals(0, result);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfChar">
<a name="apex_System_String_indexOfChar"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfChar(character)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the index of the first occurrence
of the character that corresponds to the specified character value.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfChar(<span class="keyword">Integer</span> character)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">character</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The integer value of the character in the string.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The index of the first occurrence of the specified character, -1
if the character is not found.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The index that this method
returns is in Unicode code units.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\\u03A9 is Ω (Omega)'</span>;
<span class="onelineComment">// Returns 0, which is the first character.</span>
System.debug(<span class="string">'indexOfChar(937)='</span> + str.indexOfChar(937));

<span class="onelineComment">// Output:</span>
<span class="onelineComment">// indexOfChar(937)=0</span>
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfChar_2">
<a name="apex_System_String_indexOfChar_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfChar(character, startIndex)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the index of the first occurrence
of the character that corresponds to the specified character value,
starting from the specified index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfChar(<span class="keyword">Integer</span> character,
<span class="keyword">Integer</span> startIndex)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">character</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The integer value of the character to look for.</dd>



<dt class="dt dlterm"><var class="keyword varname">startIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index to start the search from.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The index, starting from the specified start index, of the first
occurrence of the specified character, -1 if the character is not
found.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The index that this method
returns is in Unicode code units.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example shows different ways
of searching for the index of the Omega character. The first call
to <samp class="codeph apex_code">indexOfChar</samp> doesn’t
specify a start index and therefore the returned index is 0, which
is the first occurrence of Omega in the entire string. The subsequent
calls specify a start index to find the occurrence of Omega in substrings
that start at the specified index.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'Ω and \\u03A9 and Ω'</span>;
System.debug(<span class="string">'indexOfChar(937)='</span> + str.indexOfChar(937));
System.debug(<span class="string">'indexOfChar(937,1)='</span> + str.indexOfChar(937,1));
System.debug(<span class="string">'indexOfChar(937,10)='</span> + str.indexOfChar(937,10));

<span class="onelineComment">// Output:</span>
<span class="onelineComment">// indexOfChar(937)=0</span>
<span class="onelineComment">// indexOfChar(937,1)=6, (corresponds to the escaped form \\u03A9)</span>
<span class="onelineComment">// indexOfChar(937,10)=12</span>
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfDifference">
<a name="apex_System_String_indexOfDifference"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfDifference(stringToCompare)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the character where the
current String begins to differ from the specified String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfDifference(<span class="keyword">String</span> stringToCompare)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">stringToCompare</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> s2 = <span class="string">'abxc'</span>;
<span class="keyword">Integer</span> result = s1.indexOfDifference(s2);
System.assertEquals(2, result);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfIgnoreCase">
<a name="apex_System_String_indexOfIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfIgnoreCase(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the first occurrence of
the specified substring without regard to case. If the substring does
not occur, this method returns -1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfIgnoreCase(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> s2 = <span class="string">'BC'</span>;
<span class="keyword">Integer</span> result = s1.indexOfIgnoreCase(s2, 0);
System.assertEquals(1, result);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_indexOfIgnoreCase_2">
<a name="apex_System_String_indexOfIgnoreCase_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfIgnoreCase(substring, startPosition)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the zero-based index of the first occurrence of
the specified substring from the point of index <var class="keyword varname">i</var>, without regard to case. If the substring does not occur, this method
returns -1. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfIgnoreCase(<span class="keyword">String</span> substring,
<span class="keyword">Integer</span> startPosition)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">startPosition</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAllLowerCase">
<a name="apex_System_String_isAllLowerCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAllLowerCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are lowercase; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAllLowerCase()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> allLower = <span class="string">'abcde'</span>;
System.assert(allLower.isAllLowerCase());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAllUpperCase">
<a name="apex_System_String_isAllUpperCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAllUpperCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are uppercase; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAllUpperCase()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> allUpper = <span class="string">'ABCDE'</span>;
System.assert(allUpper.isAllUpperCase());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAlpha">
<a name="apex_System_String_isAlpha"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAlpha()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are Unicode letters only; otherwise,
returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAlpha()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Letters only</span>
<span class="keyword">String</span> s1 = <span class="string">'abc'</span>;
<span class="onelineComment">// Returns true</span>
<span class="keyword">Boolean</span> b1 =
   s1.isAlpha();
System.assertEquals(
   <span class="keyword">true</span>, b1);

<span class="onelineComment">// Letters and numbers</span>
<span class="keyword">String</span> s2 = <span class="string">'abc 21'</span>;
<span class="onelineComment">// Returns false</span>
<span class="keyword">Boolean</span> b2 =
   s2.isAlpha();
System.assertEquals(
   <span class="keyword">false</span>, b2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAlphaSpace">
<a name="apex_System_String_isAlphaSpace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAlphaSpace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are Unicode letters or spaces
only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAlphaSpace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> alphaSpace = <span class="string">'aA Bb'</span>;
System.assert(alphaSpace.isAlphaSpace());
<span class="keyword">String</span> notAlphaSpace = <span class="string">'ab 12'</span>;
System.assert(!notAlphaSpace.isAlphaSpace());
notAlphaSpace = <span class="string">'aA$Bb'</span>;
System.assert(!notAlphaSpace.isAlphaSpace());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAlphanumeric">
<a name="apex_System_String_isAlphanumeric"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAlphanumeric()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are Unicode letters or numbers
only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAlphanumeric()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Letters only</span>
<span class="keyword">String</span> s1 = <span class="string">'abc'</span>;
<span class="onelineComment">// Returns true</span>
<span class="keyword">Boolean</span> b1 =
   s1.isAlphanumeric();
System.assertEquals(
   <span class="keyword">true</span>, b1);

<span class="onelineComment">// Letters and numbers</span>
<span class="keyword">String</span> s2 = <span class="string">'abc021'</span>;
<span class="onelineComment">// Returns true</span>
<span class="keyword">Boolean</span> b2 =
   s2.isAlphanumeric();
System.assertEquals(
   <span class="keyword">true</span>, b2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAlphanumericSpace">
<a name="apex_System_String_isAlphanumericSpace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAlphanumericSpace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
all characters in the current String are Unicode letters, numbers,
or spaces only; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAlphanumericSpace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> alphanumSpace = <span class="string">'AE 86'</span>;
System.assert(alphanumSpace.isAlphanumericSpace());
<span class="keyword">String</span> notAlphanumSpace = <span class="string">'aA$12'</span>;
System.assert(!notAlphanumSpace.isAlphaSpace());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isAsciiPrintable">
<a name="apex_System_String_isAsciiPrintable"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isAsciiPrintable()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains only ASCII printable characters; otherwise,
returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isAsciiPrintable()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> ascii = <span class="string">'abcd1234!@#$%^&amp;*()`~-_+={[}]|:&lt;,&gt;.?'</span>;
System.assert(ascii.isAsciiPrintable());
<span class="keyword">String</span> notAscii = <span class="string">'√'</span>;
System.assert(!notAscii.isAsciiPrintable());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isBlank">
<a name="apex_System_String_isBlank"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isBlank(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the specified String is white space, empty (), or null; otherwise,
returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">Boolean</span> isBlank(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> blank = <span class="string"></span>;
<span class="keyword">String</span> nullString = <span class="keyword">null</span>;
<span class="keyword">String</span> whitespace = <span class="string">'  '</span>;
System.assert(<span class="keyword">String</span>.isBlank(blank));
System.assert(<span class="keyword">String</span>.isBlank(nullString));
System.assert(<span class="keyword">String</span>.isBlank(whitespace));
<span class="keyword">String</span> alpha = <span class="string">'Hello'</span>;
System.assert(!<span class="keyword">String</span>.isBlank(alpha));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isEmpty">
<a name="apex_System_String_isEmpty"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isEmpty(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the specified String is empty () or null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">Boolean</span> isEmpty(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> empty = <span class="string"></span>;
<span class="keyword">String</span> nullString = <span class="keyword">null</span>;
System.assert(<span class="keyword">String</span>.isEmpty(empty));
System.assert(<span class="keyword">String</span>.isEmpty(nullString));
<span class="keyword">String</span> whitespace = <span class="string">'  '</span>;
<span class="keyword">String</span> alpha = <span class="string">'Hello'</span>;
System.assert(!<span class="keyword">String</span>.isEmpty(whitespace));
System.assert(!<span class="keyword">String</span>.isEmpty(alpha));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isNotBlank">
<a name="apex_System_String_isNotBlank"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isNotBlank(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the specified String is not whitespace, not empty (), and not null;
otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">Boolean</span> isNotBlank(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> alpha = <span class="string">'Hello world!'</span>;
System.assert(<span class="keyword">String</span>.isNotBlank(alpha));
<span class="keyword">String</span> blank = <span class="string"></span>;
<span class="keyword">String</span> nullString = <span class="keyword">null</span>;
<span class="keyword">String</span> whitespace = <span class="string">'  '</span>;
System.assert(!<span class="keyword">String</span>.isNotBlank(blank));
System.assert(!<span class="keyword">String</span>.isNotBlank(nullString));
System.assert(!<span class="keyword">String</span>.isNotBlank(whitespace));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isNotEmpty">
<a name="apex_System_String_isNotEmpty"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isNotEmpty(inputString)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the specified String is not empty () and not null; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">Boolean</span> isNotEmpty(<span class="keyword">String</span> inputString)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">inputString</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> whitespace = <span class="string">'  '</span>;
<span class="keyword">String</span> alpha = <span class="string">'Hello world!'</span>;
System.assert(<span class="keyword">String</span>.isNotEmpty(whitespace));
System.assert(<span class="keyword">String</span>.isNotEmpty(alpha));
<span class="keyword">String</span> empty = <span class="string"></span>;
<span class="keyword">String</span> nullString = <span class="keyword">null</span>;
System.assert(!<span class="keyword">String</span>.isNotEmpty(empty));
System.assert(!<span class="keyword">String</span>.isNotEmpty(nullString));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isNumeric">
<a name="apex_System_String_isNumeric"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isNumeric()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains only Unicode digits; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isNumeric()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p" id="decimalPoint"><a name="decimalPoint"><!– –></a>A decimal
point (1.2) is not a Unicode digit.</p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> numeric = <span class="string">'1234567890'</span>;
System.assert(numeric.isNumeric());
<span class="keyword">String</span> alphanumeric = <span class="string">'R32'</span>;
<span class="keyword">String</span> decimalPoint = <span class="string">'1.2'</span>;
System.assert(!alphanumeric.isNumeric());
System.assert(!decimalpoint.isNumeric());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isNumericSpace">
<a name="apex_System_String_isNumericSpace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isNumericSpace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String contains only Unicode digits or spaces; otherwise,
returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isNumericSpace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">A decimal point (1.2) is
not a Unicode digit.</p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> numericSpace = <span class="string">'1 2 3'</span>;
System.assert(numericSpace.isNumericspace());
<span class="keyword">String</span> notNumericspace = <span class="string">'FD3S FC3S'</span>;
System.assert(!notNumericspace.isNumericspace());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_isWhitespace">
<a name="apex_System_String_isWhitespace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">isWhitespace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if the current String contains only
    white space characters or is empty; otherwise, returns <samp class="codeph apex_code"><span class="keyword">false</span></samp>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> isWhitespace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> whitespace = <span class="string">' '</span>;
<span class="keyword">String</span> blank = <span class="string"></span>;
System.assert(whitespace.isWhitespace());
System.assert(blank.isWhitespace());
<span class="keyword">String</span> alphanum = <span class="string">'SIL80'</span>;
System.assert(!alphanum.isWhitespace());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_join">
<a name="apex_System_String_join"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">join(iterableObj, separator)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Joins the elements of the specified iterable object, such
as a List, into a single String separated by the specified separator.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> join(<span class="keyword">Object</span> iterableObj,
<span class="keyword">String</span> separator)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">iterableObj</var></dt>

<dd class="dd">Type: Object</dd>



<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex">List&lt;<span class="keyword">Integer</span>&gt; li = <span class="keyword">new</span>
   List&lt;<span class="keyword">Integer</span>&gt;
   {10, 20, 30};
<span class="keyword">String</span> s = <span class="keyword">String</span>.join(
   li, <span class="string">'/'</span>);
System.assertEquals(
   <span class="string">'10/20/30'</span>, s);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOf">
<a name="apex_System_String_lastIndexOf"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">lastIndexOf(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the index of the last occurrence of the specified
substring. If the substring does not occur, this method returns -1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> lastIndexOf(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdefgc'</span>;
<span class="keyword">Integer</span> i1 = s1.lastIndexOf(<span class="string">'c'</span>);
System.assertEquals(7, i1);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOf_2">
<a name="apex_System_String_lastIndexOf_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">lastIndexOf(substring, endPosition)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the index of the last occurrence of the specified
substring, starting from the character at index 0 and ending at the
specified index. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> lastIndexOf(<span class="keyword">String</span> substring,
<span class="keyword">Integer</span> endPosition)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">endPosition</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the substring doesn’t occur
or <var class="keyword varname">endPosition</var> is negative, this method returns
1. If <var class="keyword varname">endPosition</var> is larger than the last index
in the current String, the entire String is searched.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdaacd'</span>;
<span class="keyword">Integer</span> i1 =
   s1.lastIndexOf(<span class="string">'c'</span>, 7);
System.assertEquals(
   6, i1);
<span class="keyword">Integer</span> i2 =
   s1.lastIndexOf(<span class="string">'c'</span>, 3);
System.assertEquals(
   2, i2);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOfChar">
<a name="apex_System_String_lastIndexOfChar"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">indexOfChar(character)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the index of the last occurrence
of the character that corresponds to the specified character value.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> indexOfChar(<span class="keyword">Integer</span> character)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">character</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The integer value of the character in the string.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The index of the last occurrence of the specified character, -1 if
the character is not found.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The index that this method
returns is in Unicode code units.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'\u03A9 is Ω (Omega)'</span>;
<span class="onelineComment">// Get the last occurrence of Omega.</span>
System.assertEquals(5, str.lastIndexOfChar(937));</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOfChar_2">
<a name="apex_System_String_lastIndexOfChar_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">lastIndexOfChar(character, endIndex)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the index of the last occurrence
of the character that corresponds to the specified character value,
starting from the specified index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> lastIndexOfChar(<span class="keyword">Integer</span> character,
<span class="keyword">Integer</span> endIndex)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">character</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The integer value of the character to look for.</dd>



<dt class="dt dlterm"><var class="keyword varname">endIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The index to end the search at.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The index, starting from the specified start index, of the last occurrence
of the specified character. -1 if the character is not found.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">The index that this method
returns is in Unicode code units.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example shows different ways
of searching for the index of the last occurrence of the Omega character.
The first call to <samp class="codeph apex_code">lastIndexOfChar</samp> doesn’t specify an end index and therefore the returned index
is 12, which is the last occurrence of Omega in the entire string.
The subsequent calls specify an end index to find the last occurrence
of Omega in substrings.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'Ω and \u03A9 and Ω'</span>;
System.assertEquals(12, str.lastIndexOfChar(937));
System.assertEquals(6, str.lastIndexOfChar(937,11));
System.assertEquals(0, str.lastIndexOfChar(937,5));</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOfIgnoreCase">
<a name="apex_System_String_lastIndexOfIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">lastIndexOfIgnoreCase(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the index of the last occurrence of the specified
substring regardless of case. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> lastIndexOfIgnoreCase(<span class="keyword">String</span>
substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the substring doesn’t
occur, this method returns -1.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdaacd'</span>;
<span class="keyword">Integer</span> i1 =
   s1.lastIndexOfIgnoreCase(<span class="string">'DAAC'</span>);
System.assertEquals(
   3, i1);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_lastIndexOfIgnoreCase_2">
<a name="apex_System_String_lastIndexOfIgnoreCase_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">lastIndexOfIgnoreCase(substring, endPosition)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the index of the last occurrence of the specified
substring regardless of case, starting from the character at index
0 and ending at the specified index. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> lastIndexOfIgnoreCase(<span class="keyword">String</span>
substring, <span class="keyword">Integer</span> endPosition)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">endPosition</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the substring doesn’t occur
or <var class="keyword varname">endPosition</var> is negative, this method returns
1. If <var class="keyword varname">endPosition</var> is larger than the last index
in the current String, the entire String is searched.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdaacd'</span>;
<span class="keyword">Integer</span> i1 =
   s1.lastIndexOfIgnoreCase(<span class="string">'C'</span>, 7);
System.assertEquals(
   6, i1);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_left">
<a name="apex_System_String_left"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">left(length)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the leftmost characters of the current String of
the specified length.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> left(<span class="keyword">Integer</span> length)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">length</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If <var class="keyword varname">length</var> is greater
than the String size, the entire String is returned.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdaacd'</span>;
<span class="keyword">String</span> s2 =
   s1.left(3);
System.assertEquals(
   <span class="string">'abc'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_leftPad">
<a name="apex_System_String_leftPad"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">leftPad(length)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String padded with spaces on the left
and of the specified length. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> leftPad(<span class="keyword">Integer</span> length)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">length</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If <var class="keyword varname">length</var> is less
than or equal to the current String size, the entire String is returned
without space padding.</p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abc'</span>;
<span class="keyword">String</span> s2 =
   s1.leftPad(5);
System.assertEquals(
   <span class="string">'  abc'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_length">
<a name="apex_System_String_length"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">length()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the number of 16-bit Unicode characters contained
in the String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> length()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString = <span class="string">'abcd'</span>;
<span class="keyword">Integer</span> result = myString.length();
System.assertEquals(result, 4);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_mid">
<a name="apex_System_String_mid"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">mid(startIndex, length)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a new String that begins with the character at
the specified zero-based <var class="keyword varname">startIndex</var> with the number
of characters specified by <var class="keyword varname">length</var>. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> mid(<span class="keyword">Integer</span> startIndex, <span class="keyword">Integer</span>
length)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">startIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">If <var class="keyword varname">startIndex</var> is negative, it is considered
to be zero.</dd>



<dt class="dt dlterm"><var class="keyword varname">length</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">If <var class="keyword varname">length</var> is negative or zero, an empty String
is returned. If <var class="keyword varname">length</var> is greater than the remaining
characters, the remainder of the String is returned.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">This method is similar to
the <samp class="codeph apex_code">substring(startIndex)</samp> and <samp class="codeph apex_code">substring(startIndex, endIndex)</samp> methods,
except that the second argument is the number of characters to return.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'abcde'</span>;
<span class="keyword">String</span> s2 = s.mid(2, 3);
System.assertEquals(
   <span class="string">'cde'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_normalizeSpace">
<a name="apex_System_String_normalizeSpace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">normalizeSpace()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String with leading, trailing, and
repeating white space characters removed. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> normalizeSpace()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">This method normalizes the
following white space characters: space, tab (\t), new line (\n),
carriage return (\r), and form feed (\f).</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'Salesforce \t     force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.normalizeSpace();
System.assertEquals(
   <span class="string">'Salesforce force.com'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_offsetByCodePoints">
<a name="apex_System_String_offsetByCodePoints"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">offsetByCodePoints(index, codePointOffset)</span></span></h3>



<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a>Returns the index of the Unicode code
point that is offset by the specified number of code points, starting
from the given index.</span></div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Integer</span> offsetByCodePoints(<span class="keyword">Integer</span> index,
<span class="keyword">Integer</span> codePointOffset)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">index</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The start index in the string.</dd>



<dt class="dt dlterm"><var class="keyword varname">codePointOffset</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">The number of code points to be offset.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a></p>
<p class="p">The index that corresponds to the start index that is added to the
offset.</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">Unpaired surrogates within
the text range that is specified by <var class="keyword varname">index</var> and <var class="keyword varname">codePointOffset</var> count as one code point each.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">This example calls <samp class="codeph apex_code">offsetByCodePoints</samp> on a string with
a start index of 0 (to start from the first character) and an offset
of threee code points. The string contains one sequence of supplementary
characters in escaped form (a pair of characters). After an offset
of three code points when counting from the beginning of the string,
the returned code point index is four.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> str = <span class="string">'A \uD835\uDD0A BC'</span>;
System.assertEquals(4, str.offsetByCodePoints(0,3));</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_remove">
<a name="apex_System_String_remove"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">remove(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes all occurrences of the specified substring and
returns the String result.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> remove(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Salesforce and force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.remove(<span class="string">'force'</span>);
System.assertEquals(
   <span class="string">'Sales and .com'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_removeEnd">
<a name="apex_System_String_removeEnd"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">removeEnd(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes the specified substring only if it occurs at the
end of the String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> removeEnd(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Salesforce and force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.removeEnd(<span class="string">'.com'</span>);
System.assertEquals(
   <span class="string">'Salesforce and force'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_removeEndIgnoreCase">
<a name="apex_System_String_removeEndIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">removeEndIgnoreCase(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes the specified substring only if it occurs at the
end of the String using a case-insensitive match.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> removeEndIgnoreCase(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Salesforce and force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.removeEndIgnoreCase(<span class="string">'.COM'</span>);
System.assertEquals(
   <span class="string">'Salesforce and force'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_removeStart">
<a name="apex_System_String_removeStart"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">removeStart(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes the specified substring only if it occurs at the
beginning of the String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> removeStart(<span class="keyword">String</span> substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Salesforce and force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.removeStart(<span class="string">'Sales'</span>);
System.assertEquals(
   <span class="string">'force and force.com'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_removeStartIgnoreCase">
<a name="apex_System_String_removeStartIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">removeStartIgnoreCase(substring)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes the specified substring only if it occurs at the
beginning of the String using a case-insensitive match.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> removeStartIgnoreCase(<span class="keyword">String</span>
substring)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">substring</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Salesforce and force.com'</span>;
<span class="keyword">String</span> s2 =
   s1.removeStartIgnoreCase(<span class="string">'SALES'</span>);
System.assertEquals(
   <span class="string">'force and force.com'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_repeat">
<a name="apex_System_String_repeat"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">repeat(numberOfTimes)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String repeated the specified number
of times. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> repeat(<span class="keyword">Integer</span> numberOfTimes)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">numberOfTimes</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'SFDC'</span>;
<span class="keyword">String</span> s2 =
   s1.repeat(2);
System.assertEquals(
   <span class="string">'SFDCSFDC'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_repeat_2">
<a name="apex_System_String_repeat_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">repeat(separator, numberOfTimes)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String repeated the specified number
of times using the specified separator to separate the repeated Strings. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> repeat(<span class="keyword">String</span> separator, <span class="keyword">Integer</span>
               numberOfTimes)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">numberOfTimes</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'SFDC'</span>;
<span class="keyword">String</span> s2 =
   s1.repeat(<span class="string">'-'</span>, 2);
System.assertEquals(
   <span class="string">'SFDC-SFDC'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_replace">
<a name="apex_System_String_replace"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">replace(target, replacement)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Replaces each substring of a string that matches the literal
target sequence <var class="keyword varname">target</var> with the specified literal
replacement sequence <var class="keyword varname">replacement</var>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> replace(<span class="keyword">String</span> target, <span class="keyword">String</span>
replacement)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">target</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">replacement</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abcdbca'</span>;
<span class="keyword">String</span> target = <span class="string">'bc'</span>;
<span class="keyword">String</span> replacement = <span class="string">'xy'</span>;
<span class="keyword">String</span> s2 = s1.replace(target, replacement);
System.assertEquals(<span class="string">'axydxya'</span>, s2);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_replaceAll">
<a name="apex_System_String_replaceAll"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">replaceAll(regExp, replacement)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Replaces each substring of a string that matches the regular
expression <var class="keyword varname">regExp</var> with the replacement sequence <var class="keyword varname">replacement</var>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> replaceAll(<span class="keyword">String</span> regExp, <span class="keyword">String</span>
replacement)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">regExp</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">replacement</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p"><span class="ph" id="reg_exp_link"><a name="reg_exp_link"><!– –></a>See the Java <a class="xref" href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html" target="_blank" title="html (New Window)"><samp class="codeph nolang">Pattern</samp></a> class for information on regular expressions.</span></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'a b c 5 xyz'</span>;
<span class="keyword">String</span> regExp = <span class="string">'[a-zA-Z]'</span>;
<span class="keyword">String</span> replacement = <span class="string">'1'</span>;
<span class="keyword">String</span> s2 = s1.replaceAll(regExp, replacement);
System.assertEquals(<span class="string">'1 1 1 5 111'</span>, s2);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_replaceFirst">
<a name="apex_System_String_replaceFirst"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">replaceFirst(regExp, replacement)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Replaces the first substring of a string that matches the
regular expression <var class="keyword varname">regExp</var> with the replacement
sequence <var class="keyword varname">replacement</var>. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> replaceFirst(<span class="keyword">String</span> regExp, <span class="keyword">String</span>
replacement)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">regExp</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">replacement</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">See the Java <a class="xref" href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html" target="_blank" title="html (New Window)"><samp class="codeph nolang">Pattern</samp></a> class for information on regular expressions.</p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'a b c 11 xyz'</span>;
<span class="keyword">String</span> regExp = <span class="string">'[a-zA-Z]{2}'</span>;
<span class="keyword">String</span> replacement = <span class="string">'2'</span>;
<span class="keyword">String</span> s2 = s1.replaceFirst(regExp, replacement);
System.assertEquals(<span class="string">'a b c 11 2z'</span>, s2);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_reverse">
<a name="apex_System_String_reverse"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">reverse()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String with all the characters reversed.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> reverse()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_right">
<a name="apex_System_String_right"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">right(length)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the rightmost characters of the current String
of the specified length.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> right(<span class="keyword">Integer</span> length)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">length</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">If <var class="keyword varname">length</var> is greater than the String size,
the entire String is returned.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Hello Max'</span>;
<span class="keyword">String</span> s2 =
   s1.right(3);
System.assertEquals(
   <span class="string">'Max'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_rightPad">
<a name="apex_System_String_rightPad"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">rightPad(length)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String padded with spaces on the right
and of the specified length. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> rightPad(<span class="keyword">Integer</span> length)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">length</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

<dd class="dd">If <var class="keyword varname">length</var> is less than or equal to the current
String size, the entire String is returned without space padding.</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'abc'</span>;
<span class="keyword">String</span> s2 =
   s1.rightPad(5);
System.assertEquals(
   <span class="string">'abc  '</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_split">
<a name="apex_System_String_split"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">split(regExp)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">
<span class="ph" id="split_desc"><a name="split_desc"><!– –></a><span class="ph" id="SplitDescr1"><a name="SplitDescr1"><!– –></a>Returns a list that contains each substring of
                                the String</span> that is terminated by either the regular expression
                                <var class="keyword varname">regExp</var> or the end of the String.</span>
        </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>


                        <p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span>[] split(<span class="keyword">String</span>
                                        regExp)</samp></p>



                </div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

                                        <dt class="dt dlterm"><var class="keyword varname">regExp</var></dt>

                                        <dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


                        </dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>


            <p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>[]</p>

            <div class="box message info"><div class="inner"><div class="bd"><div class="media">
<img class="img mtm" src="//res.cloudinary.com/hy4kyit2a/image/upload/img/msg_icons/helpNote_icon.gif" alt="Note"><div class="mediaBd">
<h4 class="mbs">Note</h4>
<p><span class="ph" id="split_jdk8_bug"><a name="split_jdk8_bug"><!– –></a>In API version 34.0 and earlier, a zero-width
                                                <var class="keyword varname">regExp</var> value produces an empty
                                        list item at the beginning of the method’s
                                output.</span></p>
</div>
</div></div></div></div>

        </div>

<div class="section">
<h4 class="helpHead4">Usage</h4>


                        <p class="p">See the Java <samp class="codeph nolang">Pattern</samp> class for information on
                                regular expressions.</p>

                        <p class="p"><span class="ph" id="SplitDescr2"><a name="SplitDescr2"><!– –></a>The substrings are placed in the list in the order
                                        in which they occur in the String.</span><span class="ph" id="SplitDescr3"><a name="SplitDescr3"><!– –></a>If <var class="keyword varname">regExp</var> does not match any part of the
                                        String, the resulting list has just one element containing
                                        the original String.</span></p>


                        <div class="p">For example, for <samp class="codeph apex_code"><span class="keyword">String</span> s =
                                        <span class="string">'boo:and:foo'</span></samp>:<ul class="ul bulletList">
                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">':'</span>, 2)</samp>
                                                results in <samp class="codeph apex_code">{<span class="string">'boo'</span>,
                                                  <span class="string">'and:foo'</span>}</samp>
</li>

                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">':'</span>, 5)</samp>
                                                results in <samp class="codeph apex_code">{<span class="string">'boo'</span>,
                                                  <span class="string">'and'</span>, <span class="string">'foo'</span>}</samp>
</li>

                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">':'</span>,
                                                  -2)</samp> results in <samp class="codeph apex_code">{<span class="string">'boo'</span>, <span class="string">'and'</span>,
                                                  <span class="string">'foo'</span>}</samp>
</li>

                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">'o'</span>, 5)</samp>
                                                results in <samp class="codeph apex_code">{<span class="string">'b'</span>, <span class="string"></span>,
                                                  <span class="string">':and:f'</span>, <span class="string"></span>, <span class="string"></span>}</samp>
</li>

                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">'o'</span>,
                                                  -2)</samp> results in <samp class="codeph apex_code">{<span class="string">'b'</span>, <span class="string"></span>, <span class="string">':and:f'</span>, <span class="string"></span>,
                                                  <span class="string"></span>}</samp>
</li>

                                        <li class="li">
<samp class="codeph apex_code">s.split(<span class="string">'o'</span>, 0)</samp>
                                                results in <samp class="codeph apex_code"> {<span class="string">'b'</span>,
                                                  <span class="string"></span>, <span class="string">':and:f'</span>}</samp>
</li>

                                </ul>
</div>

                </div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<p class="p">In the following example, a string is split using a backslash as a delimiter.</p>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">public</span> <span class="keyword">String</span> splitPath(<span class="keyword">String</span> filename) {
    <span class="statement">if</span> (filename == <span class="keyword">null</span>)
        <span class="statement">return</span> <span class="keyword">null</span>;
    List&lt;<span class="keyword">String</span>&gt; parts = filename.split(<span class="string">'\\\\'</span>);
    filename = parts[parts.size()-1];
    <span class="statement">return</span> filename;
}

<span class="onelineComment">// For example, if the file path is e:\\processed\\PPDSF100111.csv</span>
<span class="onelineComment">// This method splits the path and returns the last part.</span>
<span class="onelineComment">// Returned filename is PPDSF100111.csv</span>
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_split_2">
<a name="apex_System_String_split_2"><!– –></a><h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">split(regExp,
    limit)</span></span></h3>
<div class="body refbody">
<div class="shortdesc"><span class="ph" id="shortdesc"><a name="shortdesc"><!– –></a><span class="ph" id="d80221e12-d80235e14"><a name="d80221e12-d80235e14"><!– –></a>Returns a list that contains each substring of
                                the String</span> that is terminated by either the regular expression
                                <var class="keyword varname">regExp</var> or the end of the String.</span></div>
<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span>[] split(<span class="keyword">String</span> regExp, <span class="keyword">Integer</span> limit)</samp></p>

      </div>
<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">
<dt class="dt dlterm"><var class="keyword varname">regExp</var></dt>
<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>
<dd class="dd">A regular expression.</dd>


          <dt class="dt dlterm"><var class="keyword varname">limit</var></dt>

          <dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>

        </dl>
</div>
<div class="section">
<h4 class="helpHead4">Return Value</h4>

      <p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>[]</p>

      <div class="box message info"><div class="inner"><div class="bd"><div class="media">
<img class="img mtm" src="//res.cloudinary.com/hy4kyit2a/image/upload/img/msg_icons/helpNote_icon.gif" alt="Note"><div class="mediaBd">
<h4 class="mbs">Note</h4>
<p>In API version 34.0 and earlier, a zero-width
                                                <var class="keyword varname">regExp</var> value produces an empty
                                        list item at the beginning of the method’s
                                output.</p>
</div>
</div></div></div></div>
</div>

    <div class="section">
<h4 class="helpHead4">Usage</h4>


      <div class="p">
<span class="ph" id="SplitDescr4"><a name="SplitDescr4"><!– –></a>The optional <var class="keyword varname">limit</var> parameter controls the number of
          times the pattern is applied and therefore affects the length of the list.</span><ul class="ul bulletList">
              <li class="li">If <var class="keyword varname">limit</var> is greater than zero:<ul class="ul bulletList">
                  <li class="li">The pattern is applied a maximum of (<var class="keyword varname">limit</var> – 1) times.</li>

                  <li class="li">The list’s length is no greater than <var class="keyword varname">limit</var>.</li>

                  <li class="li">The list’s last entry contains all input beyond the last matched
                    delimiter.</li>

                </ul>
</li>

              <li class="li">If <var class="keyword varname">limit</var> is non-positive, the pattern is applied as many times
                as possible, and the list can have any length.</li>

              <li class="li">If <var class="keyword varname">limit</var> is zero, the pattern is applied as many times as
                possible, the list can have any length, and trailing empty strings are discarded.
              </li>

            </ul>
</div>

    </div>
</div>
</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_splitByCharacterType">
<a name="apex_System_String_splitByCharacterType"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">splitByCharacterType()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Splits the current String by character type and returns
a list of contiguous character groups of the same type as complete
tokens.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> List&lt;<span class="keyword">String</span>&gt; splitByCharacterType()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>&gt;</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">For more information about
the character types used, see <a class="xref" href="http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#getType%28char%29" target="_blank" title="HTML (New Window)">java.lang.Character.getType(char)</a>.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com platform'</span>;
List&lt;<span class="keyword">String</span>&gt; ls =
   s1.splitByCharacterType();
System.debug(ls);
<span class="onelineComment">// Writes this output:</span>
<span class="onelineComment">// (F, orce, ., com,  , platform)</span></pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_splitByCharacterTypeCamelCase">
<a name="apex_System_String_splitByCharacterTypeCamelCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">splitByCharacterTypeCamelCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Splits the current String by character type and returns
a list of contiguous character groups of the same type as complete
tokens, with the following exception: the uppercase character, if
any, immediately preceding a lowercase character token belongs to
the following character token rather than to the preceding.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> List&lt;<span class="keyword">String</span>&gt; splitByCharacterTypeCamelCase()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>&gt;</p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">For more information about
the character types used, see <a class="xref" href="http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#getType%28char%29" target="_blank" title="HTML (New Window)">java.lang.Character.getType(char)</a>.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com platform'</span>;
List&lt;<span class="keyword">String</span>&gt; ls =
   s1.splitByCharacterTypeCamelCase();
System.debug(ls);
<span class="onelineComment">// Writes this output:</span>
<span class="onelineComment">// (Force, ., com,  , platform)</span></pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_startsWith">
<a name="apex_System_String_startsWith"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">startsWith(prefix)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the String that called the method begins with the specified <var class="keyword varname">prefix</var>.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> startsWith(<span class="keyword">String</span> prefix)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">prefix</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'AE86 vs EK9'</span>;
System.assert(s1.startsWith(<span class="string">'AE86'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_startsWithIgnoreCase">
<a name="apex_System_String_startsWithIgnoreCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">startsWithIgnoreCase(prefix)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns <samp class="codeph apex_code"><span class="keyword">true</span></samp> if
the current String begins with the specified prefix regardless of
the prefix case.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">Boolean</span> startsWithIgnoreCase(<span class="keyword">String</span>
prefix)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">prefix</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_boolean.htm#apex_methods_system_boolean" title="Contains methods for the Boolean primitive data type.">Boolean</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'AE86 vs EK9'</span>;
System.assert(s1.startsWithIgnoreCase(<span class="string">'ae86'</span>));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_stripHtmlTags">
<a name="apex_System_String_stripHtmlTags"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">stripHtmlTags(htmlInput)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Removes HTML markup from the input string and returns the
plain text.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> stripHtmlTags(<span class="keyword">String</span> htmlInput)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">htmlInput</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'&lt;b&gt;hello world&lt;/b&gt;'</span>;
<span class="keyword">String</span> s2 = s1.stripHtmlTags();
System.assertEquals(
   <span class="string">'hello world'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substring">
<a name="apex_System_String_substring"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substring(startIndex)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a new String that begins with the character at
the specified zero-based <var class="keyword varname">startIndex</var> and extends
to the end of the String. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substring(<span class="keyword">Integer</span> startIndex)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">startIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'hamburger'</span>;
System.assertEquals(<span class="string">'burger'</span>, s1.substring(3));</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substring_2">
<a name="apex_System_String_substring_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substring(startIndex, endIndex)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a new String that begins with the character at
the specified zero-based <var class="keyword varname">startIndex</var> and extends
to the character at <var class="keyword varname">endIndex</var> - 1.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substring(<span class="keyword">Integer</span> startIndex,
<span class="keyword">Integer</span> endIndex)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">startIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">endIndex</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="string">'hamburger'</span>.substring(4, 8);
<span class="onelineComment">// Returns "urge"</span>

<span class="string">'smiles'</span>.substring(1, 5);
<span class="onelineComment">// Returns "mile"</span>
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringAfter">
<a name="apex_System_String_substringAfter"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringAfter(separator)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs after the first occurrence
of the specified separator.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringAfter(<span class="keyword">String</span> separator)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com.platform'</span>;
<span class="keyword">String</span> s2 =
   s1.substringAfter(<span class="string">'.'</span>);
System.assertEquals(
   <span class="string">'com.platform'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringAfterLast">
<a name="apex_System_String_substringAfterLast"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringAfterLast(separator)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs after the last occurrence
of the specified separator.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringAfterLast(<span class="keyword">String</span> separator)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com.platform'</span>;
<span class="keyword">String</span> s2 =
   s1.substringAfterLast(<span class="string">'.'</span>);
System.assertEquals(
   <span class="string">'platform'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringBefore">
<a name="apex_System_String_substringBefore"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringBefore(separator)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs before the first occurrence
of the specified separator.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringBefore(<span class="keyword">String</span> separator)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com.platform'</span>;
<span class="keyword">String</span> s2 =
   s1.substringBefore(<span class="string">'.'</span>);
System.assertEquals(
   <span class="string">'Force'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringBeforeLast">
<a name="apex_System_String_substringBeforeLast"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringBeforeLast(separator)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs before the last occurrence
of the specified separator.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringBeforeLast(<span class="keyword">String</span> separator)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">separator</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com.platform'</span>;
<span class="keyword">String</span> s2 =
   s1.substringBeforeLast(<span class="string">'.'</span>);
System.assertEquals(
   <span class="string">'Force.com'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringBetween">
<a name="apex_System_String_substringBetween"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringBetween(tag)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs between two instances of the specified
         <var class="keyword varname">tag</var> String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringBetween(<span class="keyword">String</span> tag)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">tag</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'tagYellowtag'</span>;
<span class="keyword">String</span> s2 = s1.substringBetween(<span class="string">'tag'</span>);
System.assertEquals(<span class="string">'Yellow'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_substringBetween_2">
<a name="apex_System_String_substringBetween_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">substringBetween(open, close)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the substring that occurs between the two specified
Strings.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> substringBetween(<span class="keyword">String</span> open,
<span class="keyword">String</span> close)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">open</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>



<dt class="dt dlterm"><var class="keyword varname">close</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'xYellowy'</span>;
<span class="keyword">String</span> s2 =
   s1.substringBetween(<span class="string">'x'</span>,<span class="string">'y'</span>);
System.assertEquals(
   <span class="string">'Yellow'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_swapCase">
<a name="apex_System_String_swapCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">swapCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Swaps the case of all characters and returns the resulting String by using the default
  (English US) locale. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> swapCase()</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">Upper case and title case
converts to lower case, and lower case converts to upper case.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'Force.com'</span>;
<span class="keyword">String</span> s2 = s1.swapCase();
System.assertEquals(<span class="string">'fORCE.COM'</span>, s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_toLowerCase">
<a name="apex_System_String_toLowerCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">toLowerCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Converts all of the characters in the String to lowercase using the rules of the default
    (English US) locale.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> toLowerCase()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'ThIs iS hArD tO rEaD'</span>;
System.assertEquals(<span class="string">'this is hard to read'</span>,
   s1.toLowerCase());</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_toLowerCase_2">
<a name="apex_System_String_toLowerCase_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">toLowerCase(locale)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Converts all of the characters in the String to lowercase
using the rules of the specified locale.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> toLowerCase(<span class="keyword">String</span> locale)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">locale</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Example in Turkish</span>
<span class="onelineComment">// An uppercase dotted "i", \u0304, which is İ</span>
<span class="onelineComment">// Note this contains both a İ as well as a I</span>
<span class="keyword">String</span> s1 = <span class="string">'KIYMETLİ'</span>;
<span class="keyword">String</span> s1Lower = s1.toLowerCase(<span class="string">'tr'</span>);
<span class="onelineComment">// Dotless lowercase "i", \u0131, which is ı</span>
<span class="onelineComment">// Note this has both a i and ı</span>
<span class="keyword">String</span> expected = <span class="string">'kıymetli'</span>;
System.assertEquals(expected, s1Lower);
<span class="onelineComment">// Note if this was done in toLowerCase(‘en’), it would output ‘kiymetli’</span></pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_toUpperCase">
<a name="apex_System_String_toUpperCase"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">toUpperCase()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Converts all of the characters in the String to uppercase using the rules of the default
      (English US) locale.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> toUpperCase()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> myString1 = <span class="string">'abcd'</span>;
<span class="keyword">String</span> myString2 = <span class="string">'ABCD'</span>;
myString1 =
   myString1.toUpperCase();
<span class="keyword">Boolean</span> result =
   myString1.equals(myString2);
System.assertEquals(result, <span class="keyword">true</span>);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_toUpperCase_2">
<a name="apex_System_String_toUpperCase_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">toUpperCase(locale)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Converts all of the characters in the String to the uppercase
using the rules of the specified locale. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> toUpperCase(<span class="keyword">String</span> locale)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">locale</var></dt>

<dd class="dd">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// Example in Turkish</span>
<span class="onelineComment">// Dotless lowercase "i", \u0131, which is ı</span>
<span class="onelineComment">// Note this has both a i and ı</span>
<span class="keyword">String</span> s1 = <span class="string">'imkansız'</span>;
<span class="keyword">String</span> s1Upper = s1.toUpperCase(<span class="string">'tr'</span>);
<span class="onelineComment">// An uppercase dotted "i", \u0304, which is İ</span>
<span class="onelineComment">// Note this contains both a İ as well as a I</span>
<span class="keyword">String</span> expected = <span class="string">'İMKANSIZ'</span>;
System.assertEquals(expected, s1Upper);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_trim">
<a name="apex_System_String_trim"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">trim()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a copy of the string that no longer contains any
leading or trailing white space characters. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> trim()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">Leading and trailing ASCII
control characters such as tabs and newline characters are also removed.
White space and control characters that aren’t at the beginning
or end of the sentence aren’t removed.</p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 = <span class="string">'   Hello!   '</span>;
<span class="keyword">String</span> trimmed = s1.trim();
system.assertEquals(<span class="string">'Hello!'</span>, trimmed);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_uncapitalize">
<a name="apex_System_String_uncapitalize"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">uncapitalize()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns the current String with the first letter in lowercase.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> uncapitalize()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'Hello max'</span>;
<span class="keyword">String</span> s2 =
   s1.uncapitalize();
System.assertEquals(
   <span class="string">'hello max'</span>,
    s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeCsv">
<a name="apex_System_String_unescapeCsv"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeCsv()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String representing an unescaped CSV column.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeCsv()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the String is enclosed
in double quotes and contains a comma, newline or double quote, quotes
are removed. Also, any double quote escaped characters (a pair of
double quotes) are unescaped to just one double quote.</p>
<p class="p">If the
String is not enclosed in double quotes, or is and does not contain
a comma, newline or double quote, it is returned unchanged.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'"Max1, ""Max2"""'</span>;
<span class="keyword">String</span> s2 =
   s1.unescapeCsv();
System.assertEquals(
   <span class="string">'Max1, "Max2"'</span>,
    s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeEcmaScript">
<a name="apex_System_String_unescapeEcmaScript"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeEcmaScript()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Unescapes any EcmaScript literals found in the String.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeEcmaScript()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'\"3.8\",\"3.9\"'</span>;
<span class="keyword">String</span> s2 =
   s1.unescapeEcmaScript();
System.assertEquals(
   <span class="string">'"3.8","3.9"'</span>,
   s2);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeHtml3">
<a name="apex_System_String_unescapeHtml3"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeHtml3()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Unescapes the characters in a String using HTML 3.0 entities.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeHtml3()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'&amp;quot;&amp;lt;Black&amp;amp;White&amp;gt;&amp;quot;'</span>;
<span class="keyword">String</span> s2 =
   s1.unescapeHtml3();
System.assertEquals(
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>,
   s2);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeHtml4">
<a name="apex_System_String_unescapeHtml4"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeHtml4()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Unescapes the characters in a String using HTML 4.0 entities.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeHtml4()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If an entity isn’t
recognized, it is kept as is in the returned string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'&amp;quot;&amp;lt;Black&amp;amp;White&amp;gt;&amp;quot;'</span>;
<span class="keyword">String</span> s2 =
   s1.unescapeHtml4();
System.assertEquals(
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>,
   s2);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeJava">
<a name="apex_System_String_unescapeJava"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeJava()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String whose Java literals are unescaped. Literals
unescaped include escape sequences for quotes (\\") and control characters,
such as tab (\\t), and carriage return (\\n).</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeJava()</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
<p class="p">The unescaped string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'Company: \\"Salesforce.com\\"'</span>;
<span class="keyword">String</span> unescapedStr = s.unescapeJava();
System.assertEquals(<span class="string">'Company: "Salesforce.com"'</span>, unescapedStr);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeUnicode">
<a name="apex_System_String_unescapeUnicode"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeUnicode()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String whose escaped Unicode characters are unescaped.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeUnicode()</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
<p class="p">The unescaped string.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s = <span class="string">'De onde voc\u00EA \u00E9?'</span>;
<span class="keyword">String</span> unescapedStr = s.unescapeUnicode();
System.assertEquals(<span class="string">'De onde você é?'</span>, unescapedStr);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_unescapeXml">
<a name="apex_System_String_unescapeXml"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">unescapeXml()</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Unescapes the characters in a String using XML entities.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">String</span> unescapeXml()</samp></p>
</div>


<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">Supports only the five basic
XML entities (gt, lt, quot, amp, apos). Does not support DTDs or external
entities.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">String</span> s1 =
   <span class="string">'&amp;quot;&amp;lt;Black&amp;amp;White&amp;gt;&amp;quot;'</span>;
<span class="keyword">String</span> s2 =
   s1.unescapeXml();
System.assertEquals(
   <span class="string">'"&lt;Black&amp;White&gt;"'</span>,
   s2);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf">
<a name="apex_System_String_valueOf"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(dateToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Date in
the standard “yyyy-MM-dd” format.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Date</span> dateToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">dateToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_date.htm#apex_methods_system_date" title="Contains methods for the Date primitive data type.">Date</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">Date</span> myDate = <span class="keyword">Date</span>.Today();
<span class="keyword">String</span> sDate = <span class="keyword">String</span>.valueOf(myDate);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_2">
<a name="apex_System_String_valueOf_2"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(datetimeToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Datetime
in the standard “yyyy-MM-dd HH:mm:ss” format for the
local time zone.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Datetime</span> datetimeToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">datetimeToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_datetime.htm#apex_methods_system_datetime" title="Contains methods for the Datetime primitive data type.">Datetime</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex">DateTime dt = datetime.newInstance(1996, 6, 23);
<span class="keyword">String</span> sDateTime = <span class="keyword">String</span>.valueOf(dt);
System.assertEquals(<span class="string">'1996-06-23 00:00:00'</span>, sDateTime);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_3">
<a name="apex_System_String_valueOf_3"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(decimalToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Decimal.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Decimal</span> decimalToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">decimalToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_decimal.htm#apex_methods_system_decimal" title="Contains methods for the Decimal primitive data type.">Decimal</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">Decimal</span> dec = 3.14159265;
<span class="keyword">String</span> sDecimal = <span class="keyword">String</span>.valueOf(dec);
System.assertEquals(<span class="string">'3.14159265'</span>, sDecimal);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_4">
<a name="apex_System_String_valueOf_4"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(doubleToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Double.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Double</span> doubleToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">doubleToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_double.htm#apex_methods_system_double" title="Contains methods for the Double primitive data type.">Double</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">Double</span> myDouble = 12.34;
<span class="keyword">String</span> myString =
   <span class="keyword">String</span>.valueOf(myDouble);
System.assertEquals(
  <span class="string">'12.34'</span>, myString);</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_5">
<a name="apex_System_String_valueOf_5"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(integerToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Integer.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Integer</span> integerToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">integerToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm#apex_methods_system_integer" title="Contains methods for the Integer primitive data type.">Integer</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">Integer</span> myInteger = 22;
<span class="keyword">String</span> sInteger = <span class="keyword">String</span>.valueOf(myInteger);
System.assertEquals(<span class="string">'22'</span>, sInteger);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_6">
<a name="apex_System_String_valueOf_6"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(longToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Long. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Long</span> longToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">longToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_long.htm#apex_methods_system_long" title="Contains methods for the Long primitive data type.">Long</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="keyword">Long</span> myLong = 123456789;
<span class="keyword">String</span> sLong = <span class="keyword">String</span>.valueOf(myLong);
System.assertEquals(<span class="string">'123456789'</span>, sLong);</pre></div>

  </div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOf_7">
<a name="apex_System_String_valueOf_7"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOf(toConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a string representation of the specified object
argument. </div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOf(<span class="keyword">Object</span> toConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">toConvert</var></dt>

<dd class="dd">Type: Object</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

<div class="section">
<h4 class="helpHead4">Usage</h4>
<p class="p">If the argument is not a
String, the <samp class="codeph apex_code">valueOf</samp> method
converts it into a String by calling the <samp class="codeph apex_code">toString</samp> method on the argument, if available, or any overridden <samp class="codeph apex_code">toString</samp> method if the argument is
a user-defined type. Otherwise, if no <samp class="codeph apex_code">toString</samp> method is available, it returns a String representation
of the argument.</p>
</div>

<div class="section">
<h4 class="helpHead4">Example</h4>
<div class="codeSection apex_code"><pre class="codeblock brush:apex">List&lt;<span class="keyword">Integer</span>&gt; ls =
  <span class="keyword">new</span> List&lt;<span class="keyword">Integer</span>&gt;();
ls.add(10);
ls.add(20);
<span class="keyword">String</span> strList =
   <span class="keyword">String</span>.valueOf(ls);
System.assertEquals(
  <span class="string">'(10, 20)'</span>, strList);
</pre></div>
</div>

</div>

</div>
<div class="topic reference nested2" lang="en-us" lang="en-us" id="apex_System_String_valueOfGmt">
<a name="apex_System_String_valueOfGmt"><!– –></a>
<h3 class="helpHead3"><span class="ph" id="topic-title"><a name="topic-title"><!– –></a><span class="titlecodeph">valueOfGmt(datetimeToConvert)</span></span></h3>



<div class="body refbody">
<div class="shortdesc">Returns a String that represents the specified Datetime
in the standard “yyyy-MM-dd HH:mm:ss” format for the
GMT time zone.</div>

<div class="section">
<h4 class="helpHead4">Signature</h4>
<p class="p"><samp class="codeph apex_code"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">String</span> valueOfGmt(<span class="keyword">Datetime</span> datetimeToConvert)</samp></p>
</div>

<div class="section">
<h4 class="helpHead4">Parameters</h4>
<dl class="dl detailList">

<dt class="dt dlterm"><var class="keyword varname">datetimeToConvert</var></dt>

<dd class="dd">Type: <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_methods_system_datetime.htm#apex_methods_system_datetime" title="Contains methods for the Datetime primitive data type.">Datetime</a>
</dd>


</dl>
</div>

<div class="section">
<h4 class="helpHead4">Return Value</h4>
<p class="p">Type: <a class="xref" href="#apex_methods_system_string" title="Contains methods for the String primitive data type.">String</a></p>
</div>

  <div class="section">
<h4 class="helpHead4">Example</h4>


   <div class="codeSection apex_code"><pre class="codeblock brush:apex"><span class="onelineComment">// For a PST timezone:</span>
DateTime dt = datetime.newInstance(2001, 9, 14);
<span class="keyword">String</span> sDateTime = <span class="keyword">String</span>.valueOfGmt(dt);
System.assertEquals(<span class="string">'2001-09-14 07:00:00'</span>, sDateTime);</pre>
