Commit 25/09/2025
This commit is contained in:
@@ -38,6 +38,20 @@ class Somecodes {
|
||||
// regex for getting ann_id from Message, which is the number inside []
|
||||
private val ann_id_regex = Regex("\\[(\\d+)]")
|
||||
|
||||
/**
|
||||
* Check if a string is a valid number.
|
||||
*/
|
||||
fun IsNumber(value: String) : Boolean {
|
||||
return value.toIntOrNull() != null
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a string is alphabetic (contains only letters).
|
||||
*/
|
||||
fun IsAlphabethic(value: String) : Boolean {
|
||||
return value.all { it.isLetter() }
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract ANN ID from a message string.
|
||||
* The ANN ID is expected to be a number enclosed in square brackets (e.g., "[123]").
|
||||
|
||||
Reference in New Issue
Block a user