|
d****g 发帖数: 7460 | 2 Here is my implementation. google了很久,本以为是个很基本的use case,但最后没
有找到好办法。写出来也不算太麻烦。没有考虑general的solution,也没有考虑CDData
和comment.对我们这个app应该足够了。
public static String removeNameSPace(String input1) {
String ret = null;
int strStart = 0;
boolean finished = false;
if ( input1 != null ){
StringBuffer sb = new StringBuffer(input1.length());
while (!finished){
int start = input1.indexOf('<', strStart);
int end = input1.indexOf('>', strStart);
if ( start != -1 && end != -1)... 阅读全帖 |
|
Y**G 发帖数: 1089 | 3 DFA = http://en.wikipedia.org/wiki/Deterministic_finite_automaton
The code below is the most efficient: (better than calling contains and
equals):
boolean xyzThere(String str) {
char next[] = new char[] {'x', 'y', 'z'};
int state = 0;
for (int i = 0; i < str.length(); i ++) {
char ch = str.charAt(i);
switch (status) {
case 0:
if (ch == '.') {
state = -1;
} else if (ch == 'x') {
state = 1;
}
... 阅读全帖 |
|
Y**G 发帖数: 1089 | 4 correct some typo:
boolean xyzThere(String str) {
char next[] = new char[] {'x', 'y', 'z'};
int state = 0;
for (int i = 0; i < str.length(); i ++) {
char ch = str.charAt(i);
switch (state) {
case 0:
if (ch == '.') {
state = -1;
} else if (ch == 'x') {
state = 1;
}
break;
case -1:
if (ch != '.') {
state = 0;
}
break;
... 阅读全帖 |
|
|
z****e 发帖数: 54598 | 6 楼主先把
s = ""是怎么回事想明白
s.charAt(0)这个整个内存逻辑怎么实现想出来再说
arraylist的实现要在这个基础上复杂两层 |
|
c*********p 发帖数: 3217 | 7 1.那二十多个design pattern 要不要学会
2.反射,装饰,多态,序列化,泛型,这些要不要.. 感觉像围棋手筋..
看下面这个连接,我帖出来的内容,挺简单的.会了够不够找工作?
http://www.homeandlearn.co.uk/java/java.html
This free Home and Learn course is for those wishing to learn the Java
programming language. It is aimed at complete beginners to the subject, and
no knowledge is assumed. The software you need to do the course is set out
below, in the "What you need to get started" link. Once you have downloaded
everything you need, you can make start by following the links... 阅读全帖 |
|
q**j 发帖数: 10612 | 8 detect double charaters when typing? i tried, no luck. |
|
h******n 发帖数: 4 | 9 I was trying out using a frame for navigation purpose. A single click on the
link "Prev" or "Next" will result in the change of URLs of the other two
frames (listing and examples).
Navigation Bar
|
|