add getACodepoint to the shared Strings library, and use it in NfaUtils

This commit is contained in:
erik-krogh
2023-10-12 12:59:47 +02:00
parent 822ba2ae59
commit fa1e8ee426
2 changed files with 11 additions and 5 deletions

View File

@@ -63,6 +63,12 @@ string getCodepointAt(string s, int i) {
)
}
/**
* Gets any unicode character that appears in `s`.
*/
bindingset[s]
string getACodepoint(string s) { result = s.codePointAt(_).toUnicode() }
/**
* Gets the number of unicode codepoints in `s` not counting unpaired surrogates.
*/