如果我有几个字符串:
str = "This is a cool string (orch. details here): 2. Denied."
str2 = " (Orch. details here)" <--notice the capital letter
Run Code Online (Sandbox Code Playgroud)
然后我做这行代码试图清除那部分:
str3 = Regex.Replace(str, str2, "", RegexOptions.IgnoreCase);
Run Code Online (Sandbox Code Playgroud)
str3最终完全像str执行前一样.我怀疑它是不是"看到"其他人物,如周期,因为当我做这与只是简单的字母str和str2那么它将取代它就好了.
是什么赋予了?!:)
感谢您的任何见解!
希望标题说明一切,但我想要大写字母串中第一个和最后一个字的第一个字母,如下所示:
Turn this:
this is a regular sentence
Into this:
This is a regular Sentence
Run Code Online (Sandbox Code Playgroud)
理想情况下,我希望它适用于任何角色,例如à -> À,但如果这是一个更大的交易,我不希望过度复杂化.