PowerApps 中的 EncodeUrl 和 PlainText 函式EncodeUrl and PlainText functions in PowerApps

編碼和解碼字串。Encodes and decodes strings.

說明Description

EncodeUrl 函式會編碼 URL 字串,使用 % 和十六進位數字來取代非英數字元。The EncodeUrl function encodes a URL string, replacing non-alphanumeric characters with % and a hexadecimal number.

PlainText 函式會移除 HTML 和 XML 標記,將標記 (例如這些元件) 轉換為適當的符號︰The PlainText function removes HTML and XML tags, converting tags such as these to an appropriate symbol:

  •   
  • ""

來自這些函式的傳回值是編碼或解碼的字串。The return value from these functions is the encoded or decoded string.

語法Syntax

EncodeUrl( String )EncodeUrl( String )

  • String - 必要項目。String - Required. 要編碼的 URL。URL to be encoded.

PlainText( String )PlainText( String )

  • String - 必要項目。String - Required. 將會移除 HTML 和 XML 所標記的來源字串。String from which HTML and XML tags will be stripped.

範例Examples

如果您在文字資源庫中顯示 RSS 摘要,然後將該資源庫中標籤的 Text 屬性設為 ThisItem.description,則標籤可能會顯示原始 HTML 或 XML 程式碼,如此範例所示︰If you show an RSS feed in a text gallery and then set the Text property of a label in that gallery to ThisItem.description, the label might show raw HTML or XML code as in this example:

<p>We have done an unusually&nbsp;&quot;deep&quot; globalization and localization.<p>

如果您將標籤的 Text 的屬性設為 PlainText(ThisItem.description),會出現文字,如此範例所示︰If you set the Text property of the label to PlainText(ThisItem.description), the text appears as in this example:

We have done an unusually "deep" globalization and localization.