使用通配符处理字符串返回字符串列表 [英] Processing string with wildcard returning a list of strings

查看:66
本文介绍了使用通配符处理字符串返回字符串列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找的是处理字符串值,如:0 **并且需要一个输出字符串列表,其中包含与输入值匹配但仅与数字匹配的所有值。

例如:

输入:" 0 **"



输出:(字符串列表)



" 001"

" 002"







" 010"

" 011"







" 098"

" 099"



我不知道STL库是否已经有用于此目的的东西。



谢谢。



关心

解决方案

当然STL会给出你想要的一切:

http://www.cplusplus.com/reference/string/ string / [ ^ ],

http://www.cplusplus.com/reference/vector/vector/ [ ^ ] :-)



-SA

Hi, what I am looking for is processing a string value like: "0**" and need for an output string list that contain all the values that matches the input value but only with digits.
In example:
Input: "0**"

Output: (a string list)

"001"
"002"
.
.
.
"010"
"011"
.
.
.
"098"
"099"

I don''t know if STL library has already something that can be useful for this purpose.

Thanks.

Regards

解决方案

Of course STL will give you all you want:
http://www.cplusplus.com/reference/string/string/[^],
http://www.cplusplus.com/reference/vector/vector/[^] :-)

—SA


这篇关于使用通配符处理字符串返回字符串列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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