Anonymous user
Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Idiomatically determine all the characters that can be used for symbols (view source)
Revision as of 12:56, 11 September 2014
, 9 years ago→{{header|Java}}: shorter
Walterpachl (talk | contribs) m (→{{header|PARI/GP}}: typo) |
(→{{header|Java}}: shorter) |
||
Line 17:
=={{header|Java}}==
{{works with|Java|8}}
<lang java>import java.util.
import java.util.stream.IntStream;
public class Test {
public static void main(String[] args) throws Exception {
IntStream.rangeClosed(0, 0x10FFFF)▼
▲ .filter(Character::isJavaIdentifierStart)
.limit(72)▼
.forEach(cp -> System.out.printf("%c", cp));▼
System.out.println("...");▼
▲ .filter(Character::isJavaIdentifierPart)
.limit(25)▼
▲ .filter(Character::isIdentifierIgnorable)
▲ .filter(Character::isUnicodeIdentifierStart)
}
▲ .filter(Character::isUnicodeIdentifierPart)
static void print(String msg, int start, int end, int limit,
IntPredicate p, String fmt) {
System.out.println("...");
}
|