正则替换地址中的 $ 符号

huangapple go评论45阅读模式
英文:

Regexreplace $ in address

问题

我想要在几个单元格中去掉"$"符号。
一个单元格包含例如"$q$3",但我想将它改成"Q3"。
如何使用regexreplace函数解决这个问题?
有人能帮忙吗?谢谢!

英文:

I would like to get rid of "$" in several cells.
A cell contains f.e. "$q$3", but I would to change it into "Q3"

How to fix this with function regexreplace?

Anyone? Thanks for helping!

答案1

得分: 3

Here's the translated content:

这取决于您编写代码的语言,因此保罗·丹普西先生的备注是这样的。

这是一个处理C#中移除特殊字符的链接,这是microsoft.learn的一个链接:

using System.Text.RegularExpressions;

string input = "$q$3";
string pattern = "\$";
string replacement = "";
string result = Regex.Replace(input, pattern, replacement);

如果您在搜索引擎中输入正则表达式和工具,您将找到许多工具,这里有一个在线.NET编译器

如果这个答案对您有帮助,请给保罗·丹普西先生的备注点个赞。谢谢。

如果有任何拼写错误、明显错误等,请您提出批评以改进答案。

英文:

Well it depends in what language your coding, hence the remark of Mr. Paul Dempsey.

Here's a link that deals with removing special characters with c#, and here's one from microsoft.learn:

using System.Text.RegularExpressions;

string input = "$q$3";
      string pattern = "$";
      string replacement = "";
      string result = Regex.Replace(input, pattern, replacement);

if you type in regex and tools in a search engine you'll find plenty of tools and here's an on-line .Net compiler

If this answer helps you, plz give Mr. Dempsey's remark an upvote. Thank you.

Any typo's, obvious mistakes, ... . Plz be so kind to post a remark to improve the answer.

huangapple
  • 本文由 发表于 2023年5月11日 01:22:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76221099.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定