如何找到一个特殊字符串并替换该字符串 [英] how to ffind a particualr string and replace that string
问题描述
hi
i有一个字符串作为示例如下所示
setVar1_Variable.set(setVar1_Variable_Value, comment ='setVar1_Variable_Comment',report = 0,format ='%s')
这个我想找到字符串setVar1_Variable并希望用新字符串替换这个字符串..
并且不想在setVar1_Variable_Value和'setVar1_Variable_Comment'中进行任何更改。
请帮忙我这个.......
hi
i have a string as example as shown below
setVar1_Variable.set(setVar1_Variable_Value, comment= 'setVar1_Variable_Comment', report= 0, format= '%s')
in this i want to find the string setVar1_Variable and want toreplace this string with new string ..
and dont want to make any change in setVar1_Variable_Value and 'setVar1_Variable_Comment'.
please help me on this.......
推荐答案
String.Replace(string,string) [ ^ ]
String.Replace(string,string)[^]
string myString = "The word cool is replaced in this string";
string newString = myString.Replace("cool", "awesome");
newstring现在等于在这个字符串中替换了awesome这个词
newstring now equals "The word awesome is replaced in this string"
这篇关于如何找到一个特殊字符串并替换该字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!