Skip to content

Commit

Permalink
Restore String.split(String, Int) overload and make it deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-g committed May 26, 2015
1 parent 1566ea8 commit 5f319e6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libraries/stdlib/src/kotlin/text/StringsJVM.kt
Expand Up @@ -130,9 +130,14 @@ public fun String.split(regex: Pattern, limit: Int = 0): List<String>
/**
* Splits this string around matches of the given regular expression.
*/
deprecated("Convert an argument to regex with toRegex or use splitBy instead.")
public fun String.split(regex: String): Array<String> = split(regex.toRegex()).toTypedArray()
deprecated("Convert String argument to regex with toRegex or use splitBy instead.")
public fun String.split(regex: String): Array<String> = (this as java.lang.String).split(regex)

/**
* Splits this string into at most [limit] chunks around matches of the given regular expression.
*/
deprecated("Convert String argument to regex with toRegex or use splitBy instead.")
public fun String.split(regex: String, limit: Int): Array<String> = (this as java.lang.String).split(regex, limit)

/**
* Returns a substring of this string starting with the specified index.
Expand Down

0 comments on commit 5f319e6

Please sign in to comment.