Tag: 多线

需要获取多行字符串以在文本框Java中显示

我的项目有要求。 我在javascript中生成一个注释字符串。 Coping Option: Delete all codes and replace Source Proj Num: R21AR058864-02 Source PI Last Name: SZALAI Appl ID: 7924675; File Year: 7924675 我将它发送到服务器,我将其作为字符串存储在db中,然后我将其检索回来并在textarea中显示它。 我在javascript中生成它: codingHistoryComment += ‘Source Proj Num: ‘+’\n’; codingHistoryComment += ‘Source PI Last Name: ‘+’\n’; codingHistoryComment += ‘Appl ID: ; File Year: ‘+’\n’; 在java中我试图将\ n替换为 : String str = soChild2.getChild(“codingHistoryComment”).getValue().trim(); if(str.contains(“\\n”)){ […]