[squeak-dev] The Trunk: EToys-mt.493.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Feb 24 09:57:35 UTC 2023


Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.493.mcz

==================== Summary ====================

Name: EToys-mt.493
Author: mt
Time: 24 February 2023, 10:57:32.196067 am
UUID: 026f5e7f-48a8-df46-9d7f-dd63f4acf991
Ancestors: EToys-mt.492

Merges a fix from Ralph (rpb):

"This  code fixes a bug in fromCameCase.
The old code would do:  'AnExampleString' fromCamelCase ->  ' anExampleString'.
The leading space should not be there.
The problem occurs when the leading character is capitalized."

=============== Diff against EToys-mt.492 ===============

Item was changed:
  ----- Method: String>>fromCamelCase (in category '*Etoys-Squeakland-converting') -----
  fromCamelCase
  	"convert 'anExampleString' to 'an example string'"
  
+ 	^self findFeatures joinSeparatedBy: String space!
- 	| upper nextWord start |
- 	upper := ($A to: $Z) asCharacterSet.
- 	nextWord := self indexOfAnyOf: upper.
- 	nextWord = 0 ifTrue: [^self].
- 	start := 1.
- 
- 	^String streamContents: [:strm |
- 		[
- 			strm nextPutAll: (self copyFrom: start to: nextWord-1).
- 			strm space; nextPut: (self at: nextWord) asLowercase.
- 			start := nextWord+1.
- 			nextWord := self indexOfAnyOf: upper startingAt: start.
- 			nextWord = 0
- 		] whileFalse.
- 		strm nextPutAll: (self copyFrom: start to: self size).
- 	].!



More information about the Squeak-dev mailing list