Last active
August 16, 2020 11:17
-
-
Save Skyyo/e8016c3ec9ba8b0d072e7e0a48529dd4 to your computer and use it in GitHub Desktop.
uncategorized extensions #extensions
This file contains hidden or 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 String.emoji(): String = | |
String(Character.toChars(Integer.parseInt(replace("U+", ""), 16))) | |
inline fun <T> tryOrNull(f: () -> T) = | |
try { | |
f() | |
} catch (_: Exception) { | |
null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment