Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -0,0 +1,15 @@
; using substring:
user=> (subs "knight" 1)
"night"
user=> (subs "socks" 0 4)
"sock"
user=> (.substring "brooms" 1 5)
"room"
; using rest and drop-last:
user=> (apply str (rest "knight"))
"night"
user=> (apply str (drop-last "socks"))
"sock"
user=> (apply str (rest (drop-last "brooms")))
"room"

View file

@ -0,0 +1,7 @@
(let (str "rosetta")
;; strip first char
(println (1 str))
;; strip last char
(println (0 -1 str))
;; strip both first and last characters
(println (1 -1 str)))

View file

@ -1,5 +1,4 @@
/*REXX program to show removal of 1st/last/1st&last chars from a string.*/
z = 'abcdefghijk'
say ' the original string =' z

View file

@ -2,3 +2,4 @@ puts "knight"[1..-1] # strip first character
puts "socks"[0..-2] # strip last character
puts "socks".chop # alternate way to strip last character
puts "brooms"[1..-2] # strip both first and last characters
puts "与今令"[1..-2] # => 今