【发布时间】:2013-12-31 06:29:09
【问题描述】:
我正在尝试将字符串值复制到字符串,但出现错误:
从字符串“转换”
可能是空间导致错误。让我知道如何使用 VB.Net 删除这些行。
代码:
Sub Main()
Dim x As String = "<IVCreateItemPriceListType><eConnectProcessInfo xsi:nil=" + True + " /><taRequesterTrxDisabler_Items xsi:nil=" + True + " /><taIVCreateItemPriceListLine_Items><taIVCreateItemPriceListLine><ITEMNMBR>SAMSUNG</ITEMNMBR><CURNCYID>Z-US$</CURNCYID><PRCLEVEL>SUPPORT</PRCLEVEL><UOFM>Each</UOFM><UOMPRICE>80</UOMPRICE></taIVCreateItemPriceListLine><taIVCreateItemPriceListLine xsi:nil=" + True + " /></taIVCreateItemPriceListLine_Items><taIVCreateItemPriceListHeader><ITEMNMBR>SAMSUNG</ITEMNMBR><UOFM>Each</UOFM><PRCLEVEL>SUPPORT</PRCLEVEL><CURNCYID>Z-US$</CURNCYID></taIVCreateItemPriceListHeader></IVCreateItemPriceListType></eConnect>"
x = x.Replace("<eConnectProcessInfo xsi:nil=" + True + " />", "")
x = x.Replace("<taRequesterTrxDisabler_Items xsi:nil=" + True + " />", "")
x = x.Replace("<taIVCreateItemPriceListLine xsi:nil=" + True + " />", "")
End Sub
【问题讨论】: