JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Success stories
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Safe string parsing — indexOf, substring, split, and protecting against boundary errors

    Kotlin SELF
    27 level,0 lecture
    We break down how to “cut” strings safely in Kotlin: how to correctly interpret the result of indexOf (including -1), how substring boundaries work (the end is not included), why split on spaces produces empty tokens, and how the discipline of trim + filtering + returning null helps you avoid crashes on “messy” user input.
    Open
  • Output formatting

    Kotlin SELF
    27 level,1 lecture
    We’ll walk through practical console output formatting in Kotlin: string interpolation ( $ x and $ { expr }), separating “compute” from “display” (functions return String), aligning columns with padEnd()/ padStart(), building a multi-line report with joinToString() and """...""" templates + trimIndent()—using a mini project “expense tracking” as an example.
    Open
  • Building large strings: StringBuilder and beyond

    Kotlin SELF
    27 level,2 lecture
    Let’s break down why string concatenation with + and += inside loops leads to extra copying, how to efficiently assemble multi-line text using StringBuilder (methods append(), appendLine(), finalizing via toString()), when it’s easier to use joinToString(), and which mistakes most often happen when formatting reports and line breaks.
    Open
  • Regex minimum — Regex(...) and replace for text normalization

    Kotlin SELF
    27 level,3 lecture
    We cover a minimally sufficient set of regular expressions in Kotlin: how to create a Regex object via Regex("..."), how to apply replace to normalize “dirty” input, why raw strings """...""" are convenient, and which patterns are most often needed in practice: \s+ for collapsing whitespace, [-_\s]+ for unifying separators, and \d for masking digits. At the end — typical mistakes when using Regex.replace.
    Open
  • takeIf and takeUnless: guard conditions and pairing with Elvis ?:

    Kotlin SELF
    27 level,4 lecture
    We break down how takeIf and takeUnless turn “bad” values into null, so you can then handle them uniformly via the safe call ?. and the Elvis operator ?:. Using practical examples (validating indexOf, normalizing CLI input, parsing via toIntOrNull), we learn to write compact guard expressions without extra branching—and understand where a plain if is more honest and readable.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush