a**********0 发帖数: 422 | 1 【 以下文字转载自 Java 讨论区 】
发信人: apprentice00 (数学学徒), 信区: Java
标 题: 如何确保每次读入的字符串都是unique的
发信站: BBS 未名空间站 (Mon Jul 29 10:39:48 2013, 美东)
每次读入一个string 但是程序需要每次读入的string原先没有读入过 也就是unique的
想到了hashset 但是我的程序没有如我所愿 即使有时候读入的东西以前读到过 也照
读不误 代码如下 请帮忙指点
String result = "";
boolean flag = true;
while(true) {
for (int i = 0; i < k; i++) {
... 阅读全帖 |
|
b**********5 发帖数: 7881 | 2 it's probably not because preorder/inorder, it's about how u deliminate the
string... |
|
l*******i 发帖数: 57 | 3 turn each space in the original value string into \space
turn each \ into double \
then you can use space as the deliminator |
|
e****e 发帖数: 3450 | 4 如果要把两列中间的tab deliminate去掉有什么简单方法没有?我用apropos 没找到
,谢谢阿
例如 input:
+ AF001540
- AF001540
+ AF001541
- AF001541
output:
+AF001540
-AF001540
+AF001541
-AF001541 |
|
y*e 发帖数: 9799 | 5 Can you write your question in English? I don't even understand what you're
trying to accomplish... Your input is a string with empty space
deliminator, and you want to break it down? You want to write this in Perl? |
|
b*s 发帖数: 82482 | 6 空格键是legit deliminator,white space符号之一……
就是相对更多强调现场感,技巧,不可重复,这一类的东西。
你的空格键怀了? |
|
c*****t 发帖数: 1879 | 7 A collaborator who implemented a webservice for me just dump the data in
a simple xml output for one query due to the complexity of the data, and
several tab deliminated tables for another query. |
|
a**********0 发帖数: 422 | 8 每次读入一个string 但是程序需要每次读入的string原先没有读入过 也就是unique的
想到了hashset 但是我的程序没有如我所愿 即使有时候读入的东西以前读到过 也照
读不误 代码如下 请帮忙指点
String result = "";
boolean flag = true;
while(true) {
for (int i = 0; i < k; i++) {
HashSet aux = new HashSet();
Random randomGenerator = new Random();
... 阅读全帖 |
|