From 65580ff23ede9864ca713f3e7e84eb9b541c1690 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 5 Dec 2019 17:32:13 +0000 Subject: [PATCH] Update from Forestry.io Harsh Shandilya updated content/posts/teachingkotlin-part-3--caveats-coming-from-java.md --- .../posts/teachingkotlin-part-3--caveats-coming-from-java.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/posts/teachingkotlin-part-3--caveats-coming-from-java.md b/content/posts/teachingkotlin-part-3--caveats-coming-from-java.md index acc2897..a15640d 100644 --- a/content/posts/teachingkotlin-part-3--caveats-coming-from-java.md +++ b/content/posts/teachingkotlin-part-3--caveats-coming-from-java.md @@ -14,5 +14,4 @@ When you start migrating your Java code to Kotlin, you will encounter multiple s Java's `java.lang.String#split` [method](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#split-java.lang.String-) takes a `String` as it's first argument and creates a `Regex` out of it before attempting to split. Kotlin, however, has two variants of this method. One takes a `String` and uses it as a plaintext delimiter, and the other takes a `Regex` behaving like the Java method we mentioned earlier. Code that was directly converted from Java to Kotlin will fail to accommodate this difference, so be on the lookout. -

#ProTip: When converting your Java code to #Kotlin, remember to double check if you were relying on java.lang.String's implicit Regex conversion, because Kotlin does not do it.pic.twitter.com/u5DnDRJdx6

— Harsh Shandilya (@MSF_Jarvis) December 4, 2019
- \ No newline at end of file +{{< tweet 1202077283579826176 >}} \ No newline at end of file