Hello Alex,
AC Thanks. I'll try to start with the indexing table for each character first.
AC Anyway do you know how to split string based on more than 1
AC character, for example I want to split string based on some
AC punctuation. I have tried using tokenBasedOn, but still can not
AC figured
Am 25.09.2008 um 06:40 schrieb Randal L. Schwartz:
Herbert == Herbert König [EMAIL PROTECTED] writes:
Herbert Hello Alex,
AC Thanks. I'll try to start with the indexing table for each
character first.
AC Anyway do you know how to split string based on more than 1
AC character, for example
Hello Randal,
Herbert mySeparators := Array new: 13
Herbert mySeparators at: 1 put: $- ; at: 2 put: $( .
Herbert and so on.
RLS You can just write that as a literal:
RLS mySeparators := #($- $().
actually yes but I really have 13 separators (ugly) and I may have
done it that way if it
Am 25.09.2008 um 08:33 schrieb Herbert König:
Hello Randal,
Herbert mySeparators := Array new: 13
Herbert mySeparators at: 1 put: $- ; at: 2 put: $( .
Herbert and so on.
RLS You can just write that as a literal:
RLS mySeparators := #($- $().
actually yes but I really have 13
Hello Bert,
BF Err, what's wrong with using a String?
BF mySeparators := '-(...'
oops, yes. Even the blank looks good in there.
I just haven't groked yet that Strings are Collections :-)
Cheers,
Herbert
___
Beginners mailing list
Hi guys,
I am just beginner in Smaltalk and I have some problem with collection in
smalltalk.
For this problem I have to define the value of an alphabetic character based on
its location in the alphabet. So ‘a’ and ‘A’ each have value 1, ‘b’ and ‘B’
each have 2, etc. Non-alphabetic
You need to break this down into its component parts:
Write a method that tells you score of a character
Write a method that tells you the score of a string (hint: use inject:into:)
Write a method that tells you the dollar words (hint: use select: and
splitOn:)
2008/9/24 Alex Chi [EMAIL
Hi,
As a start you can do:
alphabet := $a to: $z.
coll indexOf: $creturns 4
to have both upper and lower case:
alphabet indexOf: yourCaracter asLowercase
then you iterate on your string collection and add each result...
not sure about the $ word, but it could be once you detect the sum to
alphabet := $a to: $z.
coll indexOf: $creturns 4
returns 3 !
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Alex == Alex Chi [EMAIL PROTECTED] writes:
Alex So for example if the input is 'SmallTalk' the result is ('SmallTlk'
Alex 'SmllTlk').
Presuming the input came from someone who didn't know that Smalltalk
doesn't have a capital T. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc.
10 matches
Mail list logo