返回不包含非数字字符的字符串的函数 [英] function which returns string without non-numeric characters

查看:133
本文介绍了返回不包含非数字字符的字符串的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在寻找一个获取字符串的函数,并返回不包含非数字字符的字符串.
例如:
将字符串"A1B2C3"赋予该函数时,返回值将为:"123".
我现在很容易自己编写它,但是在c ++中不是像这样的函数吗?

谢谢,

Nir.

Hi,

I am looking for a function which gets a string, and returns that string without the characters which are not numeric.
for example:
when the string "A1B2C3" is givven to the function the returned value will be: "123".
I now its very simple to write it on my own, but isn''t any function like that in c++ ?

Thanks,

Nir.

推荐答案

不,没有这样的功能,您必须编写自己的功能.
:)
No, there isn''t such a function, you''ve to write your own.
:)


这篇关于返回不包含非数字字符的字符串的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆