简体   繁体   English

如何从Biztalk的源字符串元素中删除空格?

[英]How can I remove white spaces from source string element in Biztalk?

In my source schema there is an string element that I want to remove inline white space(s). 在我的源模式中,有一个字符串元素,我想删除行内空白。 For example: A AAAA I want to remove the second white space and string will be become AAAAA then map that to destination element. 例如:AAAAAA我要删除第二个空格,字符串将变为AAAAA,然后将其映射到目标元素。

Figure it will be challenging with built in biztalk functoids, inline C# code or xsl would work 意识到使用内置的biztalk仿函数将具有挑战性,内联C#代码或xsl可以工作

Can anyone guide me on that? 有人可以指导我吗?

Try using this code in the Map, 尝试在地图中使用此代码,

public string removeSpace(string param1)
{
 return param1.Replace(" ", "");
}

For clarity, to remove whitespace , the generally preferred approach is something like: 为了清楚起见,要删除空白 ,通常首选的方法是:

public string removeWhitespace(string input)
{
    return Regex.Replace(input, @"\s+", "");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM