Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39322
| From | Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Writing Java code while drunk and stoned take 2 |
| Date | 2020-03-03 14:20 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <r3lljf$jk5$1@dont-email.me> (permalink) |
| References | <1747103f-c38a-411e-92de-a44a52d9c761@googlegroups.com> <r39k3b$5hl$1@gioia.aioe.org> <1tqy1ikulwdol.1kgu0mlctl0av.dlg@40tude.net> <r3hlef$14g9$1@gioia.aioe.org> <8d21b2bb-009e-44b4-b873-8b4bd89ada95@googlegroups.com> |
On 2020-03-03 13:54, chad altenburg wrote:
> I'd like to point out that part of the problem stated that I had to use a for loop. Presumably because the author of this site wanted us, to like, uhh...learn how to use a for loop.
>
But you know perfectly well how to write a for-loop!
Anyway, this might do the trick:
for (int i = 0; i < str.length(); i++) {
if (i <= str.length() - 3 && str.charAt(i) == 'z' && str.charAt(i +
2) == 'p' ) {
newString += "zp";
i += 2;
}
else {
newString += str.charAt(i);
}
}
--
DF.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Writing Java code while drunk and stoned take 2 chad altenburg <cdalten@gmail.com> - 2020-02-27 06:00 -0800
Re: Writing Java code while drunk and stoned take 2 nobody@example.org (Scott) - 2020-02-27 16:39 +0000
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-02-27 09:05 -0800
Re: Writing Java code while drunk and stoned take 2 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-02-27 19:04 +0100
Re: Writing Java code while drunk and stoned take 2 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-02-27 19:05 +0100
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-02-27 10:25 -0800
Re: Writing Java code while drunk and stoned take 2 Arne Vajhøj <arne@vajhoej.dk> - 2020-02-27 18:41 -0500
Re: Writing Java code while drunk and stoned take 2 Joerg Meier <joergmmeier@arcor.de> - 2020-03-01 22:50 +0100
Re: Writing Java code while drunk and stoned take 2 Arne Vajhøj <arne@vajhoej.dk> - 2020-03-01 19:53 -0500
Re: Writing Java code while drunk and stoned take 2 chad altenburg <cdalten@gmail.com> - 2020-03-03 04:54 -0800
Re: Writing Java code while drunk and stoned take 2 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-03-03 14:20 +0100
Re: Writing Java code while drunk and stoned take 2 Joerg Meier <joergmmeier@arcor.de> - 2020-03-03 15:00 +0100
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-03 08:19 -0800
Re: Writing Java code while drunk and stoned take 2 chad altenburg <cdalten@gmail.com> - 2020-03-04 05:53 -0800
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-04 09:59 -0800
Re: Writing Java code while drunk and stoned take 2 chad altenburg <cdalten@gmail.com> - 2020-03-05 05:53 -0800
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-05 09:29 -0800
Re: Writing Java code while drunk and stoned take 2 "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-03-06 05:49 -0800
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-06 07:00 -0800
Re: Writing Java code while drunk and stoned take 2 "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-03-07 05:40 -0800
Re: Writing Java code while drunk and stoned take 2 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-03-06 17:47 +0100
Re: Writing Java code while drunk and stoned take 2 "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-03-07 05:42 -0800
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-06 09:03 -0800
Re: Writing Java code while drunk and stoned take 2 chad altenburg <cdalten@gmail.com> - 2020-03-05 07:22 -0800
Re: Writing Java code while drunk and stoned take 2 Eric Douglas <e.d.programmer@gmail.com> - 2020-03-05 07:48 -0800
Re: Writing Java code while drunk and stoned take 2 "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-03-06 05:50 -0800
Re: Writing Java code while drunk and stoned take 2 "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-03-06 05:52 -0800
csiph-web