forked from openrs2/openrs2
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
234 B
12 lines
234 B
5 years ago
|
package dev.openrs2.common
|
||
5 years ago
|
|
||
5 years ago
|
fun CharSequence.indefiniteArticle(): String {
|
||
|
require(isNotEmpty())
|
||
5 years ago
|
|
||
5 years ago
|
val first = first().toLowerCase()
|
||
|
return when (first) {
|
||
|
'a', 'e', 'i', 'o', 'u' -> "an"
|
||
|
else -> "a"
|
||
5 years ago
|
}
|
||
5 years ago
|
}
|