From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bf52245c1c52e2e9 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: End of a string???? Date: 2000/10/10 Message-ID: <01JE5.301562$i5.4364763@news1.frmt1.sfba.home.com>#1/1 X-Deja-AN: 679817645 References: X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 971201724 24.20.190.201 (Tue, 10 Oct 2000 11:15:24 PDT) Organization: @Home Network NNTP-Posting-Date: Tue, 10 Oct 2000 11:15:24 PDT Newsgroups: comp.lang.ada Date: 2000-10-10T00:00:00+00:00 List-Id: >How can I find the end of string in ada? Is there any special character >at the end of line like C's \0? Or is there any function to find the >length of a string like Java's Mystring.length()? I tried >myString'length, but it just gives me the size of array. S : String(1 .. 5); is an array of 5 Characters, ie, a 5 character long string, regardless of the contents of S. An ascii.nul has no special meaning to Ada. You may want to look at package Ada.Strings.Bounded (for variable length with a fixed maximum, like C) or at Ada.Strings.Unbounded (for variable length with additional space allocated as needed).