#include
int main()
 {
 std::string str = “192.168.9:8086”;
 std::string buffer1;
 buffer1.resize(128);
 int port = 0;
 sscanf(str.c_str(), “%[^:]:%d”, &buffer1[0],&port);
 //std::string str = “https://192.168.9:8086/test”;
 //std::string buffer1;
 //buffer1.resize(128);
 //int port = 0;
 //sscanf(str.c_str(), “https://%[^:]:%d”, &buffer1[0], &port);
 }