1、除去前导字符 //除去字符串前导0 str.erase(0,str.find_first_not_of('0')); //出去字符串中的某一部分 str.erase(0,3); 转载于:https://www.cnblogs.com/Msmw/p/11116938.html