Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 java String 变量中有以下 R 脚本(包括换行符):
d = 1 for (i in 1:150 ) { d = d + i; } print(d)
我正在寻找的是获得 R 函数,而不管新行如何。
按照前面的示例,我将得到一个包含三个字符串的数组:
第一的:d = 1
d = 1
第二:for (i in 1:150 ) { d = d + i; }
for (i in 1:150 ) { d = d + i; }
第三:print(d)
print(d)
正则表达式可以做到这一点吗?