如何更换字符串? [英] How To I Replace The String?

查看:64
本文介绍了如何更换字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个字符串动态地一个字符串值是内部另一个字符串值通常我想要替换没有括号字符串的值如何可能。请给出答案。

解决方案

< blockquote>你的问题不清楚



你在找这个

  var  stringOne =   {abcd}; 
var stringOneWithoutBracket = stringOne.Trim(' {'' }');


方法如下: http: //msdn.microsoft.com/en-us/library/system.string%28v=vs.110%29.aspx [ ^ ]。



从阅读此原始MSDN文档到工作代码的过渡是您最低专业要求的一部分。我不认为这些基本的东西可以被有效地教授,但是如果你从其他人那里得到代码,你也会放弃改变来学习这项技能,所以,请你自己做。



-SA


i have two string Dynamically one string value is withinbracket another string value is normally i want replace the value for without bracket string how to possible.Please give answer .

解决方案

Your question is not clear

Are you looking for this

var stringOne = "{abcd}";
var stringOneWithoutBracket = stringOne.Trim('{','}');


This is how: http://msdn.microsoft.com/en-us/library/system.string%28v=vs.110%29.aspx[^].

The transition from reading of this original MSDN documentation to working code is the part of your minimal professional requirements. I don't think such elementary thing can be effectively taught, but if you get the code from someone else, you will also loose the change to get learn this skill, so, please do it on your own.

—SA


这篇关于如何更换字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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