Created
January 11, 2012 21:14
-
-
Save anonymous/1596794 to your computer and use it in GitHub Desktop.
Первая задача из http://habrahabr.ru/blogs/java/136033/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args : Array<String>) { | |
val s = "fsdn kj nkjbh jhvbj jhb bhhbhj bb bbbbbbbbbb 32r wfrwefrw 324"; | |
val parts = (s as java.lang.String).split("[^a-zA-Z]+"); // WTF?! | |
var max = "" | |
for (p in parts) if (p != null && p.length > max.length) max = p; | |
System.out?.println(max); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment