src/java.base/share/classes/java/lang/String.java
changeset 55290 ceabad800468
parent 55262 7d83cf1cfa74
child 57783 a0257f1458aa
equal deleted inserted replaced
55289:fe87ca416753 55290:ceabad800468
  3014     /**
  3014     /**
  3015      * Returns a string whose value is this string, with escape sequences
  3015      * Returns a string whose value is this string, with escape sequences
  3016      * translated as if in a string literal.
  3016      * translated as if in a string literal.
  3017      * <p>
  3017      * <p>
  3018      * Escape sequences are translated as follows;
  3018      * Escape sequences are translated as follows;
  3019      * <table class="plain">
  3019      * <table class="striped">
  3020      *   <caption style="display:none">Translation</caption>
  3020      *   <caption style="display:none">Translation</caption>
  3021      *   <thead>
  3021      *   <thead>
  3022      *   <tr>
  3022      *   <tr>
  3023      *     <th scope="col">Escape</th>
  3023      *     <th scope="col">Escape</th>
  3024      *     <th scope="col">Name</th>
  3024      *     <th scope="col">Name</th>
  3025      *     <th scope="col">Translation</th>
  3025      *     <th scope="col">Translation</th>
  3026      *   </tr>
  3026      *   </tr>
  3027      *   </thead>
  3027      *   </thead>
       
  3028      *   <tbody>
  3028      *   <tr>
  3029      *   <tr>
  3029      *     <td>{@code \u005Cb}</td>
  3030      *     <th scope="row">{@code \u005Cb}</th>
  3030      *     <td>backspace</td>
  3031      *     <td>backspace</td>
  3031      *     <td>{@code U+0008}</td>
  3032      *     <td>{@code U+0008}</td>
  3032      *   </tr>
  3033      *   </tr>
  3033      *   <tr>
  3034      *   <tr>
  3034      *     <td>{@code \u005Ct}</td>
  3035      *     <th scope="row">{@code \u005Ct}</th>
  3035      *     <td>horizontal tab</td>
  3036      *     <td>horizontal tab</td>
  3036      *     <td>{@code U+0009}</td>
  3037      *     <td>{@code U+0009}</td>
  3037      *   </tr>
  3038      *   </tr>
  3038      *   <tr>
  3039      *   <tr>
  3039      *     <td>{@code \u005Cn}</td>
  3040      *     <th scope="row">{@code \u005Cn}</th>
  3040      *     <td>line feed</td>
  3041      *     <td>line feed</td>
  3041      *     <td>{@code U+000A}</td>
  3042      *     <td>{@code U+000A}</td>
  3042      *   </tr>
  3043      *   </tr>
  3043      *   <tr>
  3044      *   <tr>
  3044      *     <td>{@code \u005Cf}</td>
  3045      *     <th scope="row">{@code \u005Cf}</th>
  3045      *     <td>form feed</td>
  3046      *     <td>form feed</td>
  3046      *     <td>{@code U+000C}</td>
  3047      *     <td>{@code U+000C}</td>
  3047      *   </tr>
  3048      *   </tr>
  3048      *   <tr>
  3049      *   <tr>
  3049      *     <td>{@code \u005Cr}</td>
  3050      *     <th scope="row">{@code \u005Cr}</th>
  3050      *     <td>carriage return</td>
  3051      *     <td>carriage return</td>
  3051      *     <td>{@code U+000D}</td>
  3052      *     <td>{@code U+000D}</td>
  3052      *   </tr>
  3053      *   </tr>
  3053      *   <tr>
  3054      *   <tr>
  3054      *     <td>{@code \u005C"}</td>
  3055      *     <th scope="row">{@code \u005C"}</th>
  3055      *     <td>double quote</td>
  3056      *     <td>double quote</td>
  3056      *     <td>{@code U+0022}</td>
  3057      *     <td>{@code U+0022}</td>
  3057      *   </tr>
  3058      *   </tr>
  3058      *   <tr>
  3059      *   <tr>
  3059      *     <td>{@code \u005C'}</td>
  3060      *     <th scope="row">{@code \u005C'}</th>
  3060      *     <td>single quote</td>
  3061      *     <td>single quote</td>
  3061      *     <td>{@code U+0027}</td>
  3062      *     <td>{@code U+0027}</td>
  3062      *   </tr>
  3063      *   </tr>
  3063      *   <tr>
  3064      *   <tr>
  3064      *     <td>{@code \u005C\u005C}</td>
  3065      *     <th scope="row">{@code \u005C\u005C}</th>
  3065      *     <td>backslash</td>
  3066      *     <td>backslash</td>
  3066      *     <td>{@code U+005C}</td>
  3067      *     <td>{@code U+005C}</td>
  3067      *   </tr>
  3068      *   </tr>
  3068      *   <tr>
  3069      *   <tr>
  3069      *     <td>{@code \u005C0 - \u005C377}</td>
  3070      *     <th scope="row">{@code \u005C0 - \u005C377}</th>
  3070      *     <td>octal escape</td>
  3071      *     <td>octal escape</td>
  3071      *     <td>code point equivalents</td>
  3072      *     <td>code point equivalents</td>
  3072      *   </tr>
  3073      *   </tr>
       
  3074      *   </tbody>
  3073      * </table>
  3075      * </table>
  3074      *
  3076      *
  3075      * @implNote
  3077      * @implNote
  3076      * This method does <em>not</em> translate Unicode escapes such as "{@code \u005cu2022}".
  3078      * This method does <em>not</em> translate Unicode escapes such as "{@code \u005cu2022}".
  3077      * Unicode escapes are translated by the Java compiler when reading input characters and
  3079      * Unicode escapes are translated by the Java compiler when reading input characters and