comparison modules/string.tp @ 157:55e0dca7d3d7

Partial implementation of HTTP get requests
author Mike Pavone <pavone@retrodev.com>
date Sat, 10 Aug 2013 15:06:56 -0700
parents 6e579a75a0a9
children 38140b7dbe3d
comparison
equal deleted inserted replaced
156:d6e79885bd3b 157:55e0dca7d3d7
185 self <- from: pos + (delim length) 185 self <- from: pos + (delim length)
186 } 186 }
187 pieces append: self 187 pieces append: self
188 } 188 }
189 189
190 trim <- {
191 l <- length
192 start <- 0
193 space <- " " byte: 0
194 tab <- "\t" byte: 0
195 nl <- "\n" byte: 0
196 cr <- "\r" byte: 0
197
198 while: {
199 if: start < l {
200 b <- byte: start
201 b = space || b = tab || b = nl || b = cr
202 }
203 } do: {
204 start <- start + 1
205 }
206 end <- l
207 while: {
208 if: end > 0 {
209 b <- byte: end
210 b = space || b = tab || b = nl || b = cr
211 }
212 } do: {
213 end <- end + 1
214 }
215 from: start withLength: (end - start)
216 }
217
190 isInteger? <- { false } 218 isInteger? <- { false }
191 isString? <- { true } 219 isString? <- { true }
192 } 220 }