@scala.annotation.tailrec
def trimAnus
(str
: String
): String
= str.
lastOption match { case Some
(' ') | Some
('\t') ⇒
trimAnus(str.dropRight(1))
str
}
println(s"`${trimAnus("124325 345 \t")}`")
}
b2JqZWN0IE1haW4gZXh0ZW5kcyBBcHAgewogIEBzY2FsYS5hbm5vdGF0aW9uLnRhaWxyZWMKICBkZWYgdHJpbUFudXMoc3RyOiBTdHJpbmcpOiBTdHJpbmcgPSBzdHIubGFzdE9wdGlvbiBtYXRjaCB7CiAgICBjYXNlIFNvbWUoJyAnKSB8IFNvbWUoJ1x0Jykg4oeSCiAgICAgIHRyaW1BbnVzKHN0ci5kcm9wUmlnaHQoMSkpCgkKICAgIGNhc2UgXyDih5IgCiAgICAgIHN0cgogIH0KICAKICBwcmludGxuKHMiYCR7dHJpbUFudXMoIjEyNDMyNSAzNDUgICAgXHQiKX1gIikKfQ==