根据文本中的后退箭头符号分割文本

时间:2019-10-23 19:09:47

标签: javascript typescript

我从API调用中获得了下面的文本,带有一些特定的符号,如下图的“圆圈”所示。 我需要根据此符号(后退箭头符号)拆分文本。 有人可以让我知道这个符号是什么吗?

Text to be splitted

  

根据要求发布行文本:

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

1 个答案:

答案 0 :(得分:0)

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

相关问题