Java字符串在Unix上被拆分
我正在使用字符串生成器创建字符串消息Java字符串在Unix上被拆分,java,linux,string,unix,Java,Linux,String,Unix,我正在使用字符串生成器创建字符串消息 StringBuilder outputMessage = new StringBuilder("<env:Envelope xsi:schemaLocation=\"OTC_Matching_FX_1-0 /xmls/OTC/OTC_Matching_FX_1-0.xsd http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd http://www.
StringBuilder outputMessage = new StringBuilder("<env:Envelope xsi:schemaLocation=\"OTC_Matching_FX_1-0 /xmls/OTC/OTC_Matching_FX_1-0.xsd http://schemas.xmlsoap.org/soap/envelope/ /xmls/OTC/soap-envelope.xsd http://www.fpml.org/FpML-5/confirmation /xmls/OTC/fpml-main-5-1.xsd\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:fpml=\"http://www.fpml.org/FpML-5/confirmation\" xmlns:mtc=\"OTC_Matching_FX_1-0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
这是Unix上的输出:
我无法理解为什么会发生这种情况。为什么字符串在字符之间被分割?您是否尝试过不使用StringBuilder<代码>字符串s=新字符串(“您的文本”)代码>?实际上,我需要将许多其他字符串附加到此字符串,因此使用StringBuilder您是否尝试使用
System.out.println(outputMessage.toString())
?它是如何输出字符串的?是的,它以相同的方式打印字符串。但仅在unix上,在ide内部,它可以在单行上打印。您是否尝试过在文本查看器中禁用换行功能?
LOGGER.info("Output: "+outputMessage.toString());