课程表

VB.Net基本教程

VB.Net高级教程

工具箱
速查手册

VB.Net - 替换

当前位置:免费教程 » 程序设计 » VB.Net

替换被用在替换模式中。如下表所示:

字符 描述 模式 替换模式 输入字符 结果字符
$number 用被命名的数字组替换匹配的字符串。 \b(\w+)(\s)(\w+)\b $3$2$1"one two""two one"
${name} 用被命名的 groupname替换匹配的字符串。 \b(?< word1>\w+)(\s)(?< word2>\w+)\b${word2} ${word1} "one two""two one"
$$ 替换美元符"$" \b(\d+)\s?USD$$$1 "103 USD""$103"
$& 替换整个匹配的复制品 (\$*(\d*(\.+\d+)?){1}) **$& "$1.30""**$1.30**"
$` Substitutes all the text of the input string before the match.在匹配前替换输入字符中的所有文本。 B+ $` "AABBCC""AAAACC"
$' Substitutes all the text of the input string after the match.在匹配后替换输入字符中的所有文本。 B+ $' "AABBCC""AACCCC"
$+ Substitutes the last group that was captured.替换最后被捕获的组。 B+(C+) $+ "AABBCCDD"AACCDD
$_ Substitutes the entire input string.替换整个输入字符串。 B+ $_ "AABBCC" "AAAABBCCCC"
转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号