Anonymous | Login | 02-25-2021 04:43 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
0006666 | [Squeak] Collections | minor | always | 09-09-07 13:30 | 09-10-07 00:25 | |||||||
Reporter | JTS | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | open | |||||||||
Status | new | Product Version | 3.10 | |||||||||
Summary | 0006666: Bugs in String>>#withoutTrailingDigits | |||||||||||
Description |
StringTest>>#testWithoutTrailingDigits self assert: ' 1abc23' withoutTrailingDigits2 = ' 1abc'. self assert: '123 ' withoutTrailingDigits2 = ''. self assert: 'abc ' withoutTrailingDigits2 = 'abc'. self assert: '' withoutTrailingDigits = '' This test will fail: self assert: ' 1abc23' withoutTrailingDigits2 = ' 1abc'. It returns an empty string instead. |
|||||||||||
Additional Information |
This will past the tests: withoutTrailingDigits2 "Answer the portion of the receiver that precedes any trailing series of digits and blanks. If the receiver consists entirely of digits and blanks, return an empty string" | firstDigit | firstDigit := (self findLast: [:each | each isDigit not and: [(each = Character space) not]]). ^ firstDigit > 0 ifTrue: [self copyFrom: 1 to: firstDigit] ifFalse: [''] |
|||||||||||
Attached Files | ||||||||||||
|
![]() |
|||
Date Modified | Username | Field | Change |
09-09-07 13:30 | JTS | New Issue | |
09-10-07 00:25 | wiz | Note Added: 0011103 |
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
32 total queries executed. 27 unique queries executed. |