2023-06-05 16:37:37 +03:00
|
|
|
package OOP.Java.lab_5
|
|
|
|
|
|
|
|
class Punctuation(var punctuationMark: String) {
|
|
|
|
private val punctuationMarkOptions: Regex = Regex("\\p{Punct}")
|
|
|
|
|
|
|
|
init {
|
2023-06-05 21:46:40 +03:00
|
|
|
if (!punctuationMarkOptions.containsMatchIn(punctuationMark)) {
|
2023-06-05 16:37:37 +03:00
|
|
|
this.punctuationMark = ""
|
|
|
|
}
|
|
|
|
}
|
2023-06-05 17:11:49 +03:00
|
|
|
|
|
|
|
override fun toString(): String {
|
|
|
|
return punctuationMark
|
|
|
|
}
|
2023-06-05 16:37:37 +03:00
|
|
|
}
|