删除空格(Removing blank spaces)

编程入门 行业动态 更新时间:2024-10-27 00:31:35
删除空格(Removing blank spaces)

我的要求是从地址中删除空白行。 我是这样做的:

=Ucase(REPLACE(REPLACE(Fields!Address.Value, CHR(13), ""), CHR(10), ""))

它删除了空白行,但是换行符插入到邮政编码的中间:

汉密尔顿,ON L8R

1E2 CAN

My requirement is remove blank line from the address. I am doing it like this:

=Ucase(REPLACE(REPLACE(Fields!Address.Value, CHR(13), ""), CHR(10), ""))

It removes the blank line, however the line-breaks is inserted into the middle of the zip code:

Hamilton, ON L8R

1E2 CAN

最满意答案

您需要替换正确的字符才能删除该行。

Try =UCASE(REPLACE(Fields!Address.Value, VBCRLF, ""))

这将替换所有换行,如果您只想替换有空行的换行,则需要查找VBCRLF + VBCRLF

=UCASE(REPLACE(Fields!Address.Value, VBCRLF + VBCRLF, VBCRLF))

这个答案提供了一种实现相同结果的替代方法。

You need to replace the correct character to remove the line.

Try =UCASE(REPLACE(Fields!Address.Value, VBCRLF, ""))

That will replace all line feeds, if you only want to replace line feeds where there is an empty line you will need to look for VBCRLF + VBCRLF

=UCASE(REPLACE(Fields!Address.Value, VBCRLF + VBCRLF, VBCRLF))

This answer provides an alternative method of achieving the same result.

更多推荐

本文发布于:2023-08-07 15:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:空格   Removing   spaces   blank

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!