使用通配符处理字符串返回字符串列表

编程入门 行业动态 更新时间:2024-10-26 09:19:01
本文介绍了使用通配符处理字符串返回字符串列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找的是处理字符串值,如:0 **并且需要一个输出字符串列表,其中包含与输入值匹配但仅与数字匹配的所有值。 例如: 输入:" 0 **" 输出:(字符串列表) " 001" " 002" 。 。 。 " 010" " 011" 。 。 。 " 098" " 099" 我不知道STL库是否已经有用于此目的的东西。 谢谢。 关心

解决方案

当然STL会给出你想要的一切: www.cplusplus/reference/string/ string / [ ^ ], www.cplusplus/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: www.cplusplus/reference/string/string/[^], www.cplusplus/reference/vector/vector/[^] :-)
—SA

更多推荐

使用通配符处理字符串返回字符串列表

本文发布于:2023-10-24 14:58:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524243.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   通配符   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!