javascript - 根据文本中的后退箭头符号拆分文本
问题描述
我从 API 调用中获取以下文本,其中包含一些特定符号,如下图中的“圆圈”所示。我需要根据这个符号(后箭头符号)拆分文本。谁能告诉我,这个符号是什么?
按要求发布行文本:
“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."
解决方案
该箭头通常表示“返回”或换行符。这是在文本中手动输入换行符的地方。如果将其呈现为 HTML,则应显示换行符。如果要根据它们拆分字符串,可以使用正则表达式:str.split(/\r\n|\r|\n/)
推荐阅读
- javascript - 在 Nativescript 应用程序中将 PHAsset/AVAsset 转换为 mp4 视频
- lotus-notes - 避免复制后的本地更改
- r - 一种执行多个成对测试(例如 t 测试)的紧凑方法,其中单个变量以长格式拆分为多个类别
- xcode - 如何防止 Xcode Archive 包含我的子项目的产品?
- r - 包包装“odbc”不适用于全局连接
- python-3.x - 列出具有相同宽度的值
- git - 远程 url 环境变量
- c# - Outlook.MailItem 自定义属性问题
- python - 如何在 python 中使用 selenium 从 RadioButtons 中进行选择?
- java - 合并两个 WebElements 列表