Axapta X++;将文本附加到字符串
我目前有一个方法,根据正在加载的XML文件中的标记将两个字符串附加在一起。我还想在这两个字符串之间添加一个唯一的键,以便稍后进行解析。下面是它现在的工作方式和我希望它做什么的例子Axapta X++;将文本附加到字符串,axapta,x++,Axapta,X++,我目前有一个方法,根据正在加载的XML文件中的标记将两个字符串附加在一起。我还想在这两个字符串之间添加一个唯一的键,以便稍后进行解析。下面是它现在的工作方式和我希望它做什么的例子 -CURRENT: strValue~&elem.text()~& -GOAL: strValue~&elem.text() // If the tag is "Tag" or "Building append its text to strValue (part of item name)
-CURRENT: strValue~&elem.text()~&
-GOAL: strValue~&elem.text()
// If the tag is "Tag" or "Building append its text to strValue (part of item name)
elem = elemTag.selectSingleNode("ofda:Type",nsmgr);
if(elem && (elem.text() == "Tag" || elem.text() == "Building"))
{
elem = elemTag.selectSingleNode("ofda:Value",nsmgr);
if(elem)
{
strValue += elem.text() + "~&";
}
}
strValue+=strValue?“~&”+elem.text():elem.text()代码>?您是否尝试过strValue+=elem.text()代码>?strValue+=elem.text()可以将字符串附加在一起,但不会在两个字符串之间添加唯一的键。然后将uniqe值放在两者之间(guid或其他)。尝试将键放在“strValue+”~&“+=elem.text();”之间,但这会引发语法错误。结果是“strValue elem.text()”中间没有钥匙。在什么和什么之间?如果strValue不是空的,则strValue和elem.text()之间肯定会有“~&”;“strValue+=strValue?”~&“+elem.text():elem.text();”使用此选项连接两个字符串,但没有将~&键放在两个字符串之间。