projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d8ff37
)
contains() method
author
jihoonl
<jihoonl>
Mon, 2 Nov 2009 05:26:35 +0000
(
05:26
+0000)
committer
jihoonl
<jihoonl>
Mon, 2 Nov 2009 05:26:35 +0000
(
05:26
+0000)
Robust/src/ClassLibrary/String.java
patch
|
blob
|
history
diff --git
a/Robust/src/ClassLibrary/String.java
b/Robust/src/ClassLibrary/String.java
index 07632bec02607f87dd5b739db3b9c37bcc6b9aef..864574f05b7457a8cdb6808029909997a74140c8 100644
(file)
--- a/
Robust/src/ClassLibrary/String.java
+++ b/
Robust/src/ClassLibrary/String.java
@@
-400,6
+400,27
@@
public class String {
splitted.addElement(tmpStr);
return splitted;
+ }
+
+ public boolean contains(String str)
+ {
+ int i,j;
+ char[] strChar = str.toCharArray();
+ int cnt;
+
+ for(i = 0; i < count; i++) {
+ if(value[i] == strChar[0]) {
+ cnt=0;
+ for(j=0; j < str.length() && i+j < count;j++) {
+ if(value[i+j] == strChar[j])
+ cnt++;
+ }
+ if(cnt == str.length())
+ return true;
+ }
+ }
+
+ return false;
}
}