搜索并替换“$”在文本中 [英] Search and Replace for "$" in text

查看:69
本文介绍了搜索并替换“$”在文本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想搜索文本框并替换美元符号的任何实例

字符。但是当我这样做时,它认为它不会起作用,因为它认为'我是'

想要在生产线末端替换某些东西。我怎么告诉它

寻找字面上的美元符号?

解决方案

Terry Olson写道:
< blockquote class =post_quotes>我想搜索一个文本框并替换美元符号
字符的任何实例。但是,当我这样做时,它认为它不会起作用,因为它认为'我想要在生产线的最后替换一些东西。


什么是''它'?

我们只能猜到的一些神秘码?

我怎么说出来?要找到文字的美元符号吗?




有两点需要注意:

1)使用String.substring()与indexOf()和一些基本的

编码组合。

2)或者一个正则表达式,对于

初学者来说可能更难理解。

我会建议你选择第一个选项。


祝你好运。


Erwin Moller


我正在使用正则表达式,我尝试在

前面放一个简单的\;如在/ \


/ g这似乎有用,任何人都有更好的主意吗?


Erwin Moller
< si ****************************************** @spam yourself.com>写在

消息新闻:41 *********************** @ news.xs4all.nl ...

Terry Olson写道:

我想搜索一个文本框并替换美元符号
字符的任何实例。但是当我这样做时,它认为它不起作用,因为它认为'我想要在生产线末端替换一些东西。
什么是''它'?
我们只能猜到一些神秘的代码?

我如何告诉它
寻找文字美元符号?


1)将String.substring()与indexOf()和一些基本的
编码结合使用。
2)或者正则表达式可能更多复杂的理解



为初学者。
我建议你用第一个选项来做。

祝你好运。
< Erwin Moller



I want to search a textbox and replace any instances of the dollar sign
character. But when I do that it thinks it won''t work because it think''s I''m
looking to replace something at the end of the line. How do I tell it to
look for literal dollar signs?

解决方案

Terry Olson wrote:

I want to search a textbox and replace any instances of the dollar sign
character. But when I do that it thinks it won''t work because it think''s
I''m looking to replace something at the end of the line.
What is ''it''?
Some mysterycode we can only guess about?
How do I tell it
to look for literal dollar signs?



2 things that pop into mind:
1) use String.substring() in combination with indexOf() and some basic
coding.
2) Or a regular expression which is probably more complex to understand for
starters.
I would advise you to do it with the first option.

Good luck.

Erwin Moller


I am using Regular Expressions, I tried putting just a simple \ in front of
it; as in /\


/g and that seems to work, anyone got a better idea?

"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:41***********************@news.xs4all.nl...

Terry Olson wrote:

I want to search a textbox and replace any instances of the dollar sign
character. But when I do that it thinks it won''t work because it think''s
I''m looking to replace something at the end of the line.
What is ''it''?
Some mysterycode we can only guess about?

How do I tell it
to look for literal dollar signs?



2 things that pop into mind:
1) use String.substring() in combination with indexOf() and some basic
coding.
2) Or a regular expression which is probably more complex to understand


for starters.
I would advise you to do it with the first option.

Good luck.

Erwin Moller



这篇关于搜索并替换“$”在文本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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