Question

  • Creator
    Topic
  • #4011753

    “Split” error when running code for application

    by HarryStoun ·

    I wrote a code in Kotlin and when I run it I get an error Unresolved reference: split. I do not understand something how to fix this, because so far there is little practice with this programming language.

    fun main() {
    val str = “A:B:C”
    val delim = “:”

    val list = str.split(delim)

    println(list) // [A, B, C]
    }

    • This topic was modified 2 months ago by Avatar photokees_b.

You are posting a reply to: “Split” error when running code for application

The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our Community FAQs for details. All submitted content is subject to our Terms of Use.

All Answers

  • Author
    Replies
    • #4011760
      Avatar photo

      Reply To: “Split” error when running code for application

      by kees_b ·

      In reply to “Split” error when running code for application

      Apparently, it doesn’t know the method split for the variable str. Better study the documentation of the language.

      • This reply was modified 2 months ago by Avatar photokees_b.
      • This reply was modified 1 month, 2 weeks ago by Avatar photokees_b.
Viewing 0 reply threads