- 01Getting Started
- 02Your First Output (println)
- 03Working with Variables
- 04Conditionals (if statements)
- 05Loops (for statements)
- 06Writing a Function
- 07Working with Lists
- 08Loops (while statements)
- 09Classes (Object-Oriented Programming)
- 10Error Handling (try-catch)
- 11Sorting a List
- 12Recursive Functions
- 13Using the Standard Library
- 14The when Statement
- 15The if Expression
- 16Inheritance (Extending a Class)
- 17Writing Comments
- 18Logical Operators (&&, ||, !)
- 19Constants (const val)
- 20Splitting and Joining Strings (split, joinToString)
- 21Writing Null-Safe Code (the ?: Elvis operator)
- 22Searching a List (contains, find)
- 23Transforming a List (map)
- 24Two-Dimensional Lists (Tabular Data)
- 25Writing a Custom Exception Class
- 26Default Parameter Values
- 27Working with Set
- 28Checking Correctness (Your First Step into Testing)
- 29Higher-Order Functions (Passing a Function as an Argument)
- 30Stacks and Queues (Basic Data Structures)
- 31Type Conversion (Casting) Basics
- 32Intro to Regular Expressions (Pattern Matching)
- 33The Binary Search Algorithm
- 34Building a Caesar Cipher (a Character-Shifting Cipher)
- 35Understanding How Bubble Sort Works
- 36Building and Displaying Dates (Basic Year/Month/Day Operations)
- 37Writing Multiple Test Cases Together
- 38Speeding Up Calculations with Memoization (Caching)
- 39Normalizing Strings (trim, Unifying Case)
- 40Shallow Copy vs. Deep Copy
- 41Enum (Enumerated Types) Basics
- 42Flattening a List
- 43Reversing a String and Checking for Palindromes
- 44Pairing Up Two Lists (the zip operation)
- 45Rounding Numbers (floor, ceil, roundToInt)
- 46Multi-Line Strings (Triple Quotes)
- 47Functions That Return Multiple Values (Pair)
- 48Finding the GCD and LCM (the Euclidean Algorithm)
- 49Formatting Numbers (Padding Digits, Decimal Places)
- 50Cleanup Logic with try/catch/finally
- 51Writing Generic Functions
- 52File Reading and Writing Basics
- 53Generating Random Numbers
- 54Bitwise Operators (and, or, xor, shifts)
- 55Reading Command-Line Arguments
- 56Waiting for a Fixed Amount of Time (Thread.sleep)
- 57Watch Out for Floating-Point Rounding Errors
- 58Reading from Standard Input
- 59FizzBuzz (the Classic Practice Problem)
- 60Checking Whether a Number Is Prime
- 61Set Operations with Set (Union, Intersection, Difference)
- 62Converting Number Bases (Binary, Hex)
- 63Checking Balanced Parentheses (an Application of Stacks)
- 64Checking Whether Two Words Are Anagrams
- 65Checking Whether a Year Is a Leap Year
- 66Converting Temperature (Celsius to Fahrenheit)
- 67Prime Factorization
- 68[Applied] Build a Simple Inventory Management Tool
Using the Standard Library
In this lesson you will learn about handy features that ship with the Kotlin standard library, so you know what you do not have to build yourself. This is for anyone searching for "Kotlin standard library how to use".
Convenient string functions such as .uppercase() and .padStart() come as standard. The Kotlin standard library is designed for concision and safety, and simply knowing it makes implementation far easier.
The sample code converts to upper case with "hello".uppercase(), pads with zeros using "7".padStart(3, '0'), and reads the number of elements with listOf(1, 2, 3).size. Having a working knowledge of the string and collection APIs makes you noticeably faster at writing code.
A common stumbling block for beginners is not knowing what the standard library already provides and writing the same logic out at length by hand. Getting into the habit of checking the official documentation for something similar matters.
In real-world development, how well you know the standard library maps directly onto the quality of your code and the speed you write it.
๐งช This site can't compile or run Kotlin directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ nothing is sent anywhere).
