Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-07 17:36:07 +03:00
parent e6dc5b37a2
commit 0ad4588d2c
10 changed files with 83 additions and 18 deletions

View file

@ -1,5 +1,7 @@
package com.tangem.utils
import com.tangem.utils.StringsSigns.STARS
object StringsSigns {
const val STARS = "\u2217\u2217\u2217"

View file

@ -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
}