-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a1f9b2
commit a8d04ec
Showing
4 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,5 +49,4 @@ class Core { | |
null | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
package me.ibrahimsn.lib.util | ||
|
||
import android.widget.EditText | ||
import me.ibrahimsn.lib.Constants.CHAR_PLUS | ||
|
||
fun CharSequence?.prependPlus(): String { | ||
return StringBuilder() | ||
.append("+") | ||
.append(CHAR_PLUS) | ||
.append(this) | ||
.toString() | ||
} | ||
|
||
fun Int.prependPlus(): String { | ||
return StringBuilder() | ||
.append("+") | ||
.append(CHAR_PLUS) | ||
.append(this) | ||
.toString() | ||
} | ||
|
||
fun CharSequence?.startsWithPlus(): Boolean { | ||
return this?.startsWith("+") == true | ||
return this?.startsWith(CHAR_PLUS) == true | ||
} | ||
|
||
fun String?.clearSpaces(): String? { | ||
return this?.replace("\\s+", "") | ||
} | ||
|
||
fun <T> Collection<T>.toRawString(): String { | ||
return this.joinToString("") | ||
} | ||
|
||
fun EditText.clear() { | ||
this.setText("") | ||
} |