W3cubDocs

/Kotlin

startsWith

Platform and version requirements: JVM (1.0), JS (1.1)
fun String.startsWith(
    prefix: String, 
    ignoreCase: Boolean = false
): Boolean
Platform and version requirements: Native (1.3)
fun String.startsWith(
    prefix: String, 
    ignoreCase: Boolean
): Boolean

Returns true if this string starts with the specified prefix.

Platform and version requirements: JVM (1.0), JS (1.1)
fun String.startsWith(
    prefix: String, 
    startIndex: Int, 
    ignoreCase: Boolean = false
): Boolean
Platform and version requirements: Native (1.3)
fun String.startsWith(
    prefix: String, 
    startIndex: Int, 
    ignoreCase: Boolean
): Boolean

Returns true if a substring of this string starting at the specified offset startIndex starts with the specified prefix.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.startsWith(
    char: Char, 
    ignoreCase: Boolean = false
): Boolean

Returns true if this char sequence starts with the specified character.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.startsWith(
    prefix: CharSequence, 
    ignoreCase: Boolean = false
): Boolean

Returns true if this char sequence starts with the specified prefix.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.startsWith(
    prefix: CharSequence, 
    startIndex: Int, 
    ignoreCase: Boolean = false
): Boolean

Returns true if a substring of this char sequence starting at the specified offset startIndex starts with the specified prefix.

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/starts-with.html