From dfd5de5dced5a654c94d2b0d3fe7603875e5fb27 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 31 Oct 2006 00:35:57 +0000 Subject: [PATCH] string code --- Robust/src/ClassLibrary/String.java | 56 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/Robust/src/ClassLibrary/String.java b/Robust/src/ClassLibrary/String.java index b771e4da..211318c0 100644 --- a/Robust/src/ClassLibrary/String.java +++ b/Robust/src/ClassLibrary/String.java @@ -3,6 +3,9 @@ public class String { int count; int offset; + private String() { + } + public String(char str[]) { char charstr[]=new char[str.length]; for(int i=0;ithis.count||endIndex>this.count||beginIndex>endIndex) { + // FIXME + } + str.value=this.value; + str.count=endIndex-beginIndex; + str.offset=this.offset+beginIndex; + return str; + } + + public String subString(int beginIndex) { + return this.subString(beginIndex, this.count); + } + + public int indexOf(int ch) { + return this.indexOf(ch, 0); + } + + public int indexOf(int ch, int fromIndex) { + for(int i=fromIndex;icount || (ooffset+len)>other.count) + return false; + for(int i=0;i