comparison modules/string.tp @ 295:9a30510f6e52

Fix trim method on strings
author Michael Pavone <pavone@retrodev.com>
date Thu, 24 Jul 2014 23:51:54 -0700
parents bb4723fec05e
children 5d24b3117aa7
comparison
equal deleted inserted replaced
294:d1dc2d70bdfd 295:9a30510f6e52
45 if: len != (argb len) || bytes != (argb bytes) || (memcmp: data (argb data) bytes) { 45 if: len != (argb len) || bytes != (argb bytes) || (memcmp: data (argb data) bytes) {
46 true 46 true
47 } 47 }
48 } 48 }
49 49
50 llMessage: print withVars: {} andCode: { 50 print <- {
51 fwrite: data 1 bytes stdout 51 (file stdout) write: self
52 self 52 self
53 } 53 }
54 54
55 llMessage: string withVars: {} andCode: { 55 llMessage: string withVars: {} andCode: {
56 self 56 self
293 start <- start + 1 293 start <- start + 1
294 } 294 }
295 end <- l 295 end <- l
296 while: { 296 while: {
297 if: end > 0 { 297 if: end > 0 {
298 b <- byte: end 298 b <- byte: end - 1
299 b = space || b = tab || b = nl || b = cr 299 b = space || b = tab || b = nl || b = cr
300 } 300 }
301 } do: { 301 } do: {
302 end <- end + 1 302 end <- end - 1
303 } 303 }
304 from: start withLength: (end - start) 304 from: start withLength: (end - start)
305 } 305 }
306 306
307 endsWith? <- :suffix { 307 endsWith? <- :suffix {