Java Code Examples for jdk.nashorn.internal.runtime.ScriptRuntime#isJSWhitespace()
The following examples show how to use
jdk.nashorn.internal.runtime.ScriptRuntime#isJSWhitespace() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NativeString.java From nashorn with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static Object trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 2
Source File: NativeString.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static Object trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 3
Source File: NativeString.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 4
Source File: NativeString.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 5
Source File: NativeString.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 6
Source File: NativeString.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * ECMA 15.5.4.20 String.prototype.trim ( ) * @param self self reference * @return string trimmed from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trim(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } while (end > start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 7
Source File: NativeString.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static Object trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 8
Source File: NativeString.java From nashorn with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static Object trimRight(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 9
Source File: NativeString.java From jdk8u_nashorn with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; final int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 10
Source File: NativeString.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; final int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 11
Source File: NativeString.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 12
Source File: NativeString.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static Object trimRight(final Object self) { final String str = checkObjectToString(self); int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 13
Source File: NativeString.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 14
Source File: NativeString.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; final int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 15
Source File: NativeString.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 16
Source File: NativeString.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; final int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 17
Source File: NativeString.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 18
Source File: NativeString.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimLeft ( ) * @param self self reference * @return string trimmed left from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimLeft(final Object self) { final String str = checkObjectToString(self); int start = 0; final int end = str.length() - 1; while (start <= end && ScriptRuntime.isJSWhitespace(str.charAt(start))) { start++; } return str.substring(start, end + 1); }
Example 19
Source File: NativeString.java From jdk8u_nashorn with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }
Example 20
Source File: NativeString.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Nashorn extension: String.prototype.trimRight ( ) * @param self self reference * @return string trimmed right from whitespace */ @Function(attributes = Attribute.NOT_ENUMERABLE) public static String trimRight(final Object self) { final String str = checkObjectToString(self); final int start = 0; int end = str.length() - 1; while (end >= start && ScriptRuntime.isJSWhitespace(str.charAt(end))) { end--; } return str.substring(start, end + 1); }