MCPcopy Create free account
hub / github.com/apache/tomcat / isStringFloat

Method isStringFloat

java/org/apache/el/lang/ELSupport.java:742–757  ·  view source on GitHub ↗

Checks if a string represents a floating-point number by looking for 'E', 'e', or '.' characters. @param str the string to check @return true if the string contains floating-point notation

(final String str)

Source from the content-addressed store, hash-verified

740 * @return true if the string contains floating-point notation
741 */
742 public static boolean isStringFloat(final String str) {
743 int len = str.length();
744 if (len > 1) {
745 for (int i = 0; i < len; i++) {
746 switch (str.charAt(i)) {
747 case 'E':
748 return true;
749 case 'e':
750 return true;
751 case '.':
752 return true;
753 }
754 }
755 }
756 return false;
757 }
758
759
760 /*

Callers 2

matchesMethod · 0.95
getValueMethod · 0.95

Calls 2

lengthMethod · 0.80
charAtMethod · 0.80

Tested by

no test coverage detected