社区
C#
帖子详情
C#成批替换字符串中的同一个字符?
fxp49
2007-11-02 04:04:01
如何成批替换字符串中的同一个字符?例如替换字符串"abca"中的"a"?
有无这样的方法或函数一次性替换?
...全文
283
9
打赏
收藏
C#成批替换字符串中的同一个字符?
如何成批替换字符串中的同一个字符?例如替换字符串"abca"中的"a"? 有无这样的方法或函数一次性替换?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xierfly
2007-11-02
打赏
举报
回复
replace函数,或用正则都可以。
fxp49
2007-11-02
打赏
举报
回复
只替换字符串中所有的a. 顺便:如果要替换文章中所有的a呢?
cate12
2007-11-02
打赏
举报
回复
樓上正解
wuhq030710914
2007-11-02
打赏
举报
回复
是要替换文章中所有的a,还是只替换文章中字符串abca 中的a?
yinhongyan
2007-11-02
打赏
举报
回复
用正则表达式吧,搜索一下,例子一大堆:)
conannb
2007-11-02
打赏
举报
回复
replace函数
zhangzhiyong168
2007-11-02
打赏
举报
回复
给你举个例子:
string s="abca";
使用string的replace(string oldValue,string newValue)方法;
这个方法会把s中所有的oldValue替换为newValue;
是不是符合你的要求?
lsj_zrp
2007-11-02
打赏
举报
回复
String str = "ababa";
String strs= str.Replace("a", "1")
MessageBox.Show(strs)//"1b1b1"
jiatong1981
2007-11-02
打赏
举报
回复
string s = "abca";
s = s.Replace('a', 'x');
How to do almost everything In active directory via
C#
When it comes to programmatically accessing Microsoft's Active Directory a lot of people seem to have quite a difficult time tying all the pieces together to accomplish exactly what they want to. There are so many technologies available for communicating with LDAP that many programmers end up with a mix between COM+ ADSI calls and .NET class calls mixed into their code. ADSI code is so difficult to understand and follow that the creator of that code usually owns it for the entirety of it's lifecycle since no one else wants to support it. This article attempts to tie together the most commonly used elements involved in Active Directory Management in the simplest, most clean manner possible. I interact with Active Directory in nearly all of my applications (web & forms) and I have had to solve a lot of integration issues for many customers. When I was starting out with this technology I had a lot of growing pains so this is an attempt to help those programmers who may have a need to interact with the Directory but do not want to have to become experts in the issue. However, certain rudimentary knowledge and concepts are required in order to utilize the code. You must be familiar with such terms as: distinguishedName, ldap paths, fully qualified domain names, object attributes (single string & multi-string), and general knowledge of ldap schemas.
利用SQL的charindex实现
字符
串
数组和Split函数
大家在T-SQL
中
使用substring的时候需要注意一点,T-SQL的第一个
字符
的 下标是从1开始的,不像在
C#
中
第一
字符
是从0开始的。 原文地址:SQL
字符
串
数组操作文章出处:DIY部落(http://www.di...
【转载】利用SQL的charindex实现
字符
串
数组和Split函数
大家在T-SQL
中
使用substring的时候需要注意一点,T-SQL的第一个
字符
的 下标是从1开始的,不像在
C#
中
第一
字符
是从0开始的。 原文地址:SQL
字符
串
数组操作文章出处:DIY部落(http://www.diybl.com/course/7_databases/sql/sqlServer/2007106/76999.html) /*一、按指定符号分割
字符
串
,返回分割...
在
C#
中
使用设置 -- Settings.settings
简介 .NET Framework 2.0 允许您创建和访问在各应用程序执行会话之间保持的值。这些值称为设置。设置可以表示用户首选项,也可表示应用程序需要使用的宝贵信息。例如,可以创建一系列设置来存储应用程序配色方案的用户首选项。也可以存储指定应用程序所使用数据库的连接
字符
串
。通过设置不但可以保持对于代码外部的应用程序至关重要的信息,而且还可以创建分别存储各用户首选项的配置文件。 Vis...
Unicode
字符
集批量转码为汉字(互转)
看到网上不少地方传输
中
文的时候用的是类似/u4e2d/u56fd的
字符
,就是Unicode编码的
字符
,想知道具体什么内容,又不容易看出来,所以想把这个
字符
集解码为正常的
字符
。开始我通过Encoding转换编码格式,发现行不通,怎么都不能正常解开,然后在网上淘了些类似的解码方案,有可行的,不过我发现写的有点麻烦,而且如果我
成批
的Unicode
字符
就无法直接输出了,然后我看呀看呀看,终于,我
C#
111,115
社区成员
642,552
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章