KT-3715 make Collection.notEmpty a property

Renamed "notEmpty()" methods to "isNotEmpty()" in following classes:
    - Collection
    - String
    - Array

Added "notEmpty" property to Collection class
This commit is contained in:
Mohammad Shamsi
2013-08-19 01:20:56 +08:00
parent 8c952ebfdb
commit 5584e6ce18
10 changed files with 18 additions and 14 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ public inline fun String.matches(regex : String) : Boolean {
* @includeFunctionBody ../../test/StringTest.kt capitalize
*/
public inline fun String.capitalize(): String {
return if (notEmpty()) substring(0, 1).toUpperCase() + substring(1) else this
return if (isNotEmpty()) substring(0, 1).toUpperCase() + substring(1) else this
}
/**
@@ -26,5 +26,5 @@ public inline fun String.capitalize(): String {
* @includeFunctionBody ../../test/StringTest.kt decapitalize
*/
public inline fun String.decapitalize(): String {
return if (notEmpty()) substring(0, 1).toLowerCase() + substring(1) else this
return if (isNotEmpty()) substring(0, 1).toLowerCase() + substring(1) else this
}