Path: csiph.com!aioe.org!.POSTED.O5hsyUvK01te0L/SZurVSQ.user.gioia.aioe.org!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Inclusive or exclusive array Date: Sat, 3 Aug 2019 21:32:09 -0400 Organization: Aioe.org NNTP Server Lines: 29 Message-ID: References: <87zhkvmqx8.fsf@munus.decebal.nl> <87v9vjmkkn.fsf@munus.decebal.nl> <40442ad6-ade1-41b3-98da-1a01b6d0b7c7@googlegroups.com> <5d44779f.3066731218@core> <377a17ac-80c2-4592-aa1a-716811518e27@googlegroups.com> <5d451cf1.3109053359@core> NNTP-Posting-Host: O5hsyUvK01te0L/SZurVSQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: csiph.com comp.lang.java.programmer:39072 On 8/3/2019 1:40 AM, Scott wrote: > On Fri, 2 Aug 2019 10:58:52 -0700 (PDT), Eric Douglas > wrote: >> On Friday, August 2, 2019 at 1:48:53 PM UTC-4, Scott wrote: >>>> substring is a fun animal. I'm used to start position, length from other l= >>>> anguages then we get to java with start index, end index. >>> >>> What make it 'click' for me is when I realized that where other >>> languages use {start,len}, Java convention uses {start,start+len}. >> >> It's also the 0-base vs 1-base. >> If you want to parse the "DEF" out of "ABCDEFG" it could reference as (4,3) or (3,6) > > I haven't seen 1-based indexing in a very long time. Not since I last > touched BASIC I think. Fortran uses 1 based array indexes. Cobol may as well. Wirth languages have explicit array index start. It varies. Even JDBC use 1 based indexes for parameters and columns. Arne