<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thanks. I'll try to start with the indexing table for each character first. <br>Anyway do you know how to split string based on more than 1 character, for example I want to split string based on some punctuation. I have tried using tokenBasedOn, but still can not figured out how to use it for more than 1 separator. <br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;">----- Original Message ----<br>From: Cédrick Béler &lt;cdrick65@gmail.com&gt;<br>To: A friendly place to get answers to even the most basic questions about Squeak. &lt;beginners@lists.squeakfoundation.org&gt;<br>Sent: Wednesday, September 24, 2008 40:44 PM<br>Subject: Re: [Newbies] Collection in Smalltalk<br><br>
Hi,<br><br>As a start you can do:<br><br>alphabet := $a to: $z.<br>coll indexOf: $c&nbsp; &nbsp; returns 4<br><br>to have both upper and lower case:<br>alphabet indexOf: yourCaracter asLowercase<br><br>then you iterate on your string collection and add each result...<br><br>not sure about the $ word, but it could be once you detect the sum to be 100...<br><br>hth :)<br><br>Cédrick<br><br><br>but maybe you could reverse the collection so as to have ($a -&gt; 1&nbsp; ...<br> $z -&gt; 26)<br><br>2008/9/24 Alex Chi &lt;<a ymailto="mailto:alex_chi99@yahoo.com" href="mailto:alex_chi99@yahoo.com">alex_chi99@yahoo.com</a>&gt;:<br>&gt; Hi guys,<br>&gt;<br>&gt; I am just beginner in Smaltalk and I have some problem with collection in<br>&gt; smalltalk.<br>&gt; For this problem I have to define the value of an alphabetic character based<br>&gt; on its location in the alphabet. So 'a' and&nbsp; 'A' each have value 1, 'b' and<br>&gt; 'B' each have 2, etc.
 Non-alphabetic characters can be considered to have<br>&gt; value 0.<br>&gt; The value of a word is the sum of the value of all its characters. So<br>&gt; 'Smalltalk' has value 101 and 'abc' has value 6.<br>&gt; A dollar word is a word whose value is 100.&nbsp; I want to add a method to the<br>&gt; String class that returns all the dollar words in the string.<br>&gt;<br>&gt; So for example if the input is 'SmallTalk' the result is ('SmallTlk'<br>&gt; 'SmllTlk').<br>&gt;<br>&gt; Please kindly help me guys. Really appreciate your help.<br>&gt;<br>&gt; Thanks.<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Beginners mailing list<br>&gt; <a ymailto="mailto:Beginners@lists.squeakfoundation.org" href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners"
 target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>&gt;<br>&gt;<br><br><br><br>-- <br>Cédrick<br></div></div></div><br>

      </body></html>