首页 > 解决方案 > 根据文本中的后退箭头符号拆分文本

问题描述

我从 API 调用中获取以下文本,其中包含一些特定符号,如下图中的“圆圈”所示。我需要根据这个符号(后箭头符号)拆分文本。谁能告诉我,这个符号是什么?

要拆分的文本

按要求发布行文本:

“The endpoint is browser-based, rather than RESTful. Therefore it could 
 result in the following different scenarios,↵1. SUCCESS 
(response_type=code)↵&gt; redirect_uri?code=<authorization-code>&scope= 
<resource-owner-approved-scopes>[&state=<state-provided-by-the-client>]↵2. 
SUCCESS (response_type=token)↵&gt; redirect_uri#token=<access-token>?scope= 
<resource-owner-approved-scopes>[&state=<state-provided-by-the-client>]↵3. 
CLIENT_ERROR↵&gt; redirect_uri?error=<standard-error>&error_description= 
<description-of-the-error>↵4. FAILURE↵&gt; Resource Owner will be alerted with 
an error page and the OAuth2 flow terminates immediately."

标签: javascripttypescript

解决方案


该箭头通常表示“返回”或换行符。这是在文本中手动输入换行符的地方。如果将其呈现为 HTML,则应显示换行符。如果要根据它们拆分字符串,可以使用正则表达式:str.split(/\r\n|\r|\n/)


推荐阅读