Föläig Stäghtig j.lg.stig E täg btå tt tl tc Stäg i ht om objt l Stig E täg it modifi ft tt d h pt! Stig - l : ch[] - cot : it + lgth(): it + chat(it): ch + idxof(ch): it E täg h: Ett äd och lägd Ett tl mtod j.lg.stig Kä ig htig täg tol ll ltd ll-tc Li till i dl pimiti typ K ott K tilldl tägott "Pogmmig i " // tägott Stig = "Pogmmig i "; E tägibl ä f till tt täg-objt
Sp Stäg Någ ädb otto: pblic Stig() pblic Stig(Stig täg) pblic Stig(StigBff _tigbff) Stig = w Stig(); Stig = w Stig(""); : Stig l = "" cot = + lgth(): it + chat(it): ch + idxof(ch): it : Stig l = "" cot = + lgth(): it + chat(it): ch + idxof(ch): it Stägott "tc omlt dbbl-ftt" E ott, t.x "täg" om f till tt Stig-objt. All föomt "täg" i pogmmt f till mm objt "täg" "täg" : Stig l = "täg" cot = + lgth(): it + chat(it): ch + idxof(ch): it Add Stäg Yttlig tt ätt tt p täg ä tt dd tå d + opto äd fö dtt Stig ftnm = "Klo"; Stig m = "Kll " + ftm; Sytm.ot.pitl(m); // Kll Klo Pimiti typ ot om tomtit id tägdditio Sytm.ot.pitl(" + = " + + ); // + = Sytm.ot.pitl(" + = " + ( + )); // + = (" + = " + "" + "") (" + = " + "")
tc Mtod lgth() Atlt tc i täg ä li md täg lägd Stig = ""; //.lgth() Stig = ""; //.lgth() Stig = ""; //.lgth() Stig = + ; //.lgth() Poitio tt it tc i täg ll fö d idx Föt tct h idx idx Mtod chat() chat() äd fö tt omm åt tt tc på tt it idx pblic ch chat(it idx) Exmpl: Stig = ""; ch ch =.chat(); Sytm.ot.pitl(ch); // Si t.chat();.chat();.chat(.lgth() - ); Mtod btig() btig() äd om m ill omm åt fl ä tt tc pblic Stig btig(it ttidx) pblic Stig btig(it ttidx, it ltidx) Exmpl: Stig = ""; Stig =.btig(); Stig =.btig(, ); // //.btig(, )
Mtod idxof() Sö få ät till hög ft tt tc ll btig Rt tct idx ll pblic it idxof(ch tc) pblic it idxof(ch tc, it ttidx) pblic it idxof(stig tig) pblic it idxof(stig tig, it ttidx) Stig = "";.idxof('') == - Stig = "";.idxof('') == Stig = "";.idxof("") == Stig = + ;.idxof("") ==.idxof('', ) == Mtod ltidxof() ltidxof ö få hög till ät ft tc ll btig Rt tct idx ll pblic it ltidxof(ch tc) pblic it ltidxof(ch tc, it ttidx) pblic it ltidxof(stig tig) pblic it ltidxof(stig tig, it ttidx) j! Stig = "";.ltidxof('') == - Stig = "";.ltidxof("") == Stig = " j!";.ltidxof('') == Stig = + ;.ltidxof("") ==.ltidxof("", ) == ämfö täg T mtod fö tt jämfö täg pblic bool ql(objct Objct) // Ölgig pblic bool qligoc(stig othstig) pblic it compto(stig othstig) Tå täg ä li om d ihåll mm tc i ätt odig Stig = ""; Stig = "j";.ql(); // fl.qligoc(); // t == ; // fl (fl ätt).compto("c++"); // t.compto("pcl"); // t - == oll om dt ä mm f
Fl Mtod Kl Stig ihåll ä d mtod (äd it li oft) bool dwith(stig ffix) bool ttwith(stig pfix) Stig touppc() Stig tolowc() Stig tim() Stig plc(ch oldch, ch wch) Stig = ""; bool d =.dwith(""); // t bool tt =.ttwith(""); // t =.touppc(); // "AVAKURSEN" =.tolowc(); // "j" = " ".tim(); // "".plc('', 'o'); // "oo" Efftiitt Stäg i it modifi Nä tt äd tilldl täg p tt ytt objt -tidäd Stig ltt = ""; fo (it i = ; i < ; i++) ltt = ltt + i; Md Sytm.ctTimMilli() i mät tid fö optio log tt = Sytm.ctTimMilli(); // optio om mät log d = Sytm.ctTimMilli(); log tid = d tt; // tl m dt tog j.lg.stigbff Ä täg om modifi Någ otto: pblic StigBff() pblic StigBff(Stig _xitd_täg) Någ mtod: pblic StigBff ppd(typ t) // lägg till it pblic StigBff it(it offt, Typ t) // ätt i id offt pblic StigBff dlt(it tt, it d) // t bot tc mll pblic StigBff () // äd - j j pblic Stig tostig() // StigBff om Stig pblic ch chat(it idx) // t tct id idx pblic it idxof(stig t) // idx dä t fi (ät hög) pblic it ltidxof(stig t) // idx dä t fi (hög ät) pblic it lgth() // tl tc i tll StigBff pblic Stig btig(it tt) // btäg få tt till ltt
j.til.stigtoiz Aäd fö tt dl pp täg i dl (to), t.x t fm od mig Nomlt dl täg id mlllg, tbb och dbyt M ocå g il tc täg dl id. StigToiz (fot) // Någ otto pblic StigToiz(Stig t) // pblic StigToiz(Stig t, Stig dlim) // // Någ mtod pblic bool hmoto() // pblic Stig xtto() // pblic it cotto() //. t ä täg om dl pp. Dlim g il tc t dl id. Rt t om dt fi åg to tt ploc fm täg. Rt ät to. Rä t h måg to dt fi i täg StigToiz (fot) Dflt-gä ä whitpc Stig = "Dtt ä miglö mig."; StigToiz t = w StigToiz(); To http www.itm.mh. ~obi idx.html Dtt ä miglö mig. To Stig = "http://www.itm.mh./~obi/idx.html"; StigToiz t = w StigToiz(, ":/"); K g g gä
StigToiz (fot) Exmpl impot j.til.stigtoiz; pblic cl ROd { pblic ttic oid mi(stig[] g) { Stig mig = "Dtt ä miglö mig"; StigToiz t = w StigToiz(mig); it tlod = t.cotto(); Sytm.ot.pitl("Atl od: " + tlod); // Si t od whil (t.hmoto()) { Sytm.ot.pitl(t.xtTo()); } } }