Updated on 2026-08-14
This commit is contained in:
parent
e6dc5b37a2
commit
0ad4588d2c
10 changed files with 83 additions and 18 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package com.tangem.utils
|
||||
|
||||
import com.tangem.utils.StringsSigns.STARS
|
||||
|
||||
object StringsSigns {
|
||||
|
||||
const val STARS = "\u2217\u2217\u2217"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.tangem.utils.extensions
|
||||
|
||||
import com.tangem.utils.StringsSigns.STARS
|
||||
|
||||
/**
|
||||
* Returns the string itself if hide is false, otherwise returns a string of stars.
|
||||
*
|
||||
* @param hide A boolean flag that determines whether to hide the string.
|
||||
* If true, the string will be hidden (replaced by `STARS`).
|
||||
* If false, the original string will be returned.
|
||||
*
|
||||
* @return The original string if hide is false, or STARS if hide is true.
|
||||
*/
|
||||
fun String.orHide(hide: Boolean) : String {
|
||||
return if (hide) STARS else this
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue