简体   繁体   English

Java System.getProperty(“line.separator”)无法在apache服务器中运行

[英]Java System.getProperty(“line.separator”) not working in apache server

My method System.getProperty("line.separator") is not working in Apache server but seems to work in local Eclipse . 我的方法System.getProperty("line.separator")Apache服务器中不起作用,但似乎在本地Eclipse中工作。

Actual implementation 实际执行

str2=str1.replace(System.getProperty("line.separator"), "CH(50)");

The code works in eclipse but not in server and "line.separator is not replaced by CH(50). 代码在eclipse中工作,但在服务器中不工作,“line.separator不会被CH(50)替换。

line.seperator : Sequence used by operating system to separate lines in text files line.seperator :操作系统用于分隔文本文件中的行的序列

System.getProperty("line.seperator") is operating system dependent. System.getProperty("line.seperator")依赖于操作系统。

Your server may be Linux and you are testing it locally in windows 您的服务器可能是Linux,您正在Windows中本地测试它

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

相关问题 System.getProperty(line.separator)错误 - System.getProperty(line.separator) error 我应该缓存System.getProperty(“line.separator”)吗? - Should I cache System.getProperty(“line.separator”)? System.getProperty(“line.separator”)对于Android来说是“\ n” - System.getProperty(“line.separator”) Vs “\n” for Android System.getProperty(“line.separator”); 的区别和“\\n”? - Difference between System.getProperty(“line.separator”); and “\n”? Apache Commons Net-System.getProperty(“ line.separator”)-在Android中不起作用 - Apache Commons Net - System.getProperty(“line.separator”) - does not work in Android Java:为什么检查“\\ n”与使用System.getProperty(“line.separator”)添加的新行不匹配 - Java: Why checking for “\n” doesn't match new lines added using System.getProperty(“line.separator”) 获取没有System.getProperty(“line.separator”)的新行字符? - Getting the new line character without System.getProperty(“line.separator”)? 如何使用 System.getProperty("line.separator").toString()? - How do I use System.getProperty("line.separator").toString()? 为什么System.getProperty在Eclipse + Java 8中不起作用? - Why is the System.getProperty not working in eclipse + Java 8? Java System.getProperty(“ user.home”)目录缺少分隔符 - Java System.getProperty(“user.home”) directory missing separator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM