Skip to content

Commit e0e290d

Browse files
committed
Set Deprecated old fun
1 parent b18145c commit e0e290d

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
package omega_r.com.extensions.simple
22

3-
import androidx.appcompat.app.AppCompatActivity
43
import android.os.Bundle
5-
import android.util.Log
6-
import com.omega_r.libs.extensions.coroutines.launchDelayed
7-
import com.omega_r.libs.extensions.coroutines.launchWithTicker
8-
import kotlinx.coroutines.CoroutineScope
9-
import kotlinx.coroutines.Dispatchers
10-
import kotlin.time.DurationUnit
11-
import kotlin.time.seconds
4+
import androidx.appcompat.app.AppCompatActivity
5+
import com.omega_r.libs.extensions.string.removeNonDigit
126

137
class MainActivity : AppCompatActivity() {
148

159
override fun onCreate(savedInstanceState: Bundle?) {
1610
super.onCreate(savedInstanceState)
1711
setContentView(R.layout.activity_main)
1812

19-
2013
}
2114

2215
}

extensionslib/src/main/java/com/omega_r/libs/extensions/string/DigitExtensions.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ private val DIGIT_REGEX = Regex("[^0-9]")
55

66
fun String.removeAllWithoutDigitAndLetters() = replace(NON_DIGIT_REGEX, "")
77

8-
fun String.removeNonDigit() = replace(DIGIT_REGEX, "")
8+
fun String.removeNonDigit() = replace(DIGIT_REGEX, "")
9+
10+
@Deprecated(message = "Use removeAllWithoutDigitAndLetters instead.", replaceWith = ReplaceWith("this.removeAllWithoutDigitAndLetters()", "com.omega_r.libs.extensions.string.removeAllWithoutDigitAndLetters"))
11+
fun String?.replaceNonDigit() = this?.removeAllWithoutDigitAndLetters()
12+
13+
@Deprecated(message = "", replaceWith = ReplaceWith("this.removeNonDigit()"))
14+
fun String?.replaceDigit() = this?.removeNonDigit()

0 commit comments

Comments
 (0)