#include "StdAfx.h" #include //字符串分割函数 std::vector SplitStr(std::string str,const std::string pattern) { std::string::size_type pos; std::vector result; if (str.length() != 0) { str+=pattern;//扩展字符串以方便操作 int size=str.size(); for(int i=0; i sizeof(temp)- 2) // break; // temp[j++] = nLeftExtra[k]; // } // } // // 处理负数 // if (nInt < 0) { // m = 0 - m; // temp[j++] = '-'; // } // while (m>0) { // temp_[i++] = m % 10 + '0'; // m /= 10; // } // temp_[i] = '\0'; // i = i - 1; // while (i >= 0) { // temp[j++] = temp_[i--]; // } // temp[j] = '\0'; std::string nResult = nLeftExtra; std::stringstream ss; ss << nInt; nResult += ss.str(); nResult += nRightExtra; return nResult; }