parsePhone function

String parsePhone(
  1. String phone
)

_parsePhone will try to convert phone number in required format

Implementation

String parsePhone(String phone) {
  String chatSuffix = "@c.us";
  //String groupSuffix = "@g.us";
  String phoneNum = phone.replaceAll("+", "");
  if (!phone.contains(".us")) {
    phoneNum = "$phoneNum$chatSuffix";
  }
  return phoneNum;
}