isSurrogate function

bool isSurrogate(
  1. String str,
  2. int pos
)

Implementation

bool isSurrogate(String str, int pos) {
  return 0xd800 <= str.codeUnitAt(pos) &&
      str.codeUnitAt(pos) <= 0xdbff &&
      0xdc00 <= str.codeUnitAt(pos + 1) &&
      str.codeUnitAt(pos + 1) <= 0xdfff;
}