如何用换行符/n分割字符串 [英] How to split string with line feed /n

查看:1042
本文介绍了如何用换行符/n分割字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

我正在尝试将逻辑应用程序用于集成解决方案.我调用了一个返回记录的服务,其中一个字段是Street.此字段包含带有/n的文本,我需要将其作为分隔符,以将其拆分为我发布到的服务中的三个地址字段.

I am trying to use a logic app for a integration solution. I call a service that returns a record where one field is Street. this field contains text with /n and I need that to be the delimiter to split it into three address field in the service I post to.

我正在为实现这一目标而苦苦挣扎.任何有关如何实现这一目标的建议将不胜感激.

I am struggling with how to achieve that. Any suggestion to how to achieve that would be most appreciated.


推荐答案

您可以按照以下步骤进行操作

You can do it like below

1.为下面的每个变量初始化一个Array类型的变量

1. Initialise a variable of Array type outside for each like below

2.为每个变量都设置一个变量,如下所示.

2. Set this variable in for each with your value like below.

@split(triggerBody()?['Street'],'/n')

3.然后,在您的http形状中,您可以初始化您之前使用过的变量数组,如下所示

3. then,in your http shape you can initialise you variable array which you used earlier like below

address1:@variables('edw')[0]

address1:@variables('edw')[0]

address2:@variables('edw')[1]

address2:@variables('edw')[1]

address3:@variables('edw')[2]

address3:@variables('edw')[2]


这篇关于如何用换行符/n分割字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆