ios输入的数字如果前面有0,保留去掉0之后的数据

来源:互联网 发布:盛成网络 编辑:程序博客网 时间:2024/04/29 06:39

-(NSString*) getTheCorrectNum:(NSString*)tempString

{

    while ([tempString hasPrefix:@"0"])

    {

        tempString = [tempString substringFromIndex:1];

        NSLog(@"压缩之后的tempString:%@",tempString);

    }

        return tempString;

}

0 0
原创粉丝点击