删除空格(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.

删除空格(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.