class Unicode::DisplayWidth

def self.emoji_width(string, mode = :all, ambiguous = DEFAULT_AMBIGUOUS)

Returns width of all considered Emoji and remaining string
def self.emoji_width(string, mode = :all, ambiguous = DEFAULT_AMBIGUOUS)
  res = 0
  if emoji_set_regex = EMOJI_SEQUENCES_REGEX_MAPPING[mode]
    emoji_width_via_possible(
      string,
      Unicode::Emoji.const_get(emoji_set_regex),
      mode == :rgi_at,
      ambiguous,
    )
  elsif mode == :all_no_vs16
    no_emoji_string = string.gsub(REGEX_EMOJI_ALL_SEQUENCES){ res += 2; "" }
    [res, no_emoji_string]
  elsif mode == :vs16
    no_emoji_string = string.gsub(REGEX_EMOJI_VS16){ res += 2; "" }
    [res, no_emoji_string]
  elsif mode == :all
    no_emoji_string = string.gsub(REGEX_EMOJI_ALL_SEQUENCES_AND_VS16){ res += 2; "" }
    [res, no_emoji_string]
  else
    [0, string]
  end
end