Java 15 اسئلة واجوبة المقابلات
Question: What is String.translateEscapes() in Java 15?Answer:Occasionally we get to deal with a string that contains escaped escape sequences, such as the following: The output looks like this: Sometimes, however, we want to display the evaluated escape sequences: a newline instead of "\n", a tab instead of "\t", and a backslash instead of "\". Until now, we had to rely on third-party libraries such as Apache Commons Text for this: Starting from Java 15, we can avoid the additional dependency and use the JDK method String.translateEscapes(): The output now reads: |
احفظ للمراجعة
احفظ هذا العنصر في الإشارات المرجعية، او حدده كصعب، او ضعه في مجموعة مراجعة.
سجل الدخول لحفظ الإشارات المرجعية والاسئلة الصعبة ومجموعات المراجعة.
الاكثر فائدة حسب تقييم المستخدمين:
- What is Java 15?
- What is Text Blocks or Multi-line string in Java 15?
- What are New String and CharSequence Methods in Java 15?
- What is CharSequence.isEmpty() in Java 15?
- Provide the release notes of Java 15.