Skip to content

Instantly share code, notes, and snippets.


yiheng0/utils.kt Secret

Created Jan 22, 2021
What would you like to do?
package moe.yiheng
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
fun getDate(): String {
val simpleDateFormat = SimpleDateFormat("yyyy/MM/dd")
return simpleDateFormat.format(Date())
fun Any.println() {
fun findString(form: String,regex:String): String? {
val pattern = Pattern.compile(regex)
val matcher = pattern.matcher(form)
var result: String? = null
while (matcher.find()) {
result =
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment