唯一的ID我想採取一個字符串,如生成Java中
[item.a.1234] is very close to [item.a.2345]
,並打印出只有「項目」屏幕...我怎麼可能做到這一點。
到目前爲止,我有:
import java.io.*;
public class Solution {
public static void main(String args[]) throws Exception {
InputStreamReader istream = new InputStreamReader(System.in);
BufferedReader bReader = new BufferedReader(istream);
String output = bReader.readLine();
while (output != null){
System.out.println(output);
output = bReader.readLine();
}
}
}
但是這給了我:
[item.a.1234] is very close to [item.a.2345]
我想:
item.a.1234,item.a.2345
,而不在 「項目」 的字...有什麼建議麼?
*「...有什麼建議嗎?」*爲了更快地獲得更好的幫助,請發佈[SSCCE](http://sscce.org/),它實際上會嘗試它!鑑於'字符串'可以被硬編碼,似乎上面的源幾乎完全不相關。 –
使用字符串操作方法分隔字符串。我認爲開放和右括號是提取物品的好指標 – Diversity
而這與「生成唯一ID」有什麼關係? –