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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,612990d6f00ea42 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.201.129 with SMTP id ka1mr8854183pbc.6.1331003682011; Mon, 05 Mar 2012 19:14:42 -0800 (PST) Path: h9ni44335pbe.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Will Newsgroups: comp.lang.ada Subject: Re: Can I convert a string of letters into an array? Date: Mon, 5 Mar 2012 19:13:06 -0800 (PST) Organization: http://groups.google.com Message-ID: <9204342.4227.1331003586295.JavaMail.geo-discussion-forums@vbux23> References: <9891847.4305.1330998375979.JavaMail.geo-discussion-forums@vbai14> NNTP-Posting-Host: 134.240.94.56 Mime-Version: 1.0 X-Trace: posting.google.com 1331003681 5800 127.0.0.1 (6 Mar 2012 03:14:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 6 Mar 2012 03:14:41 +0000 (UTC) In-Reply-To: <9891847.4305.1330998375979.JavaMail.geo-discussion-forums@vbai14> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=134.240.94.56; posting-account=CZZpzgoAAAAoaHoNNp9zhY9EzQgEmxhU User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-03-05T19:13:06-08:00 List-Id: On Monday, March 5, 2012 8:46:15 PM UTC-5, Will wrote: > Hey There, >=20 > How do I convert a string of letters into an array? I am not sure how to = sort the letters in the form of a string but I know how to do it using an a= rray. Then how do I convert that array back to a string after I am done so= rting it? =20 >=20 > Thanks a bunch, >=20 > Will Here is the problem, "Write a procedure that takes in a string of 'B' and '= G' characters. The procedure should rearrange the letters into an alternat= ing 'B'-'G' pattern that continues until the less numerous letter runs out.= Assume the string only contains 'B's and 'G's; that the patter you create= always starts with a 'B'; and that the string will always contain at least= 1 of each letter. For example: "BBBBGGGBG" becomes "BGBGBGBGB", and "GGBG= " becomes "BGGG"."