Jump to content

Substring/Top and tail: Difference between revisions

no edit summary
(add Netrexx)
No edit summary
Line 276:
Readln;
end.</lang>
 
=={{header|Eero}}==
<lang objc>#import <Foundation/Foundation.h>
 
int main()
autoreleasepool
 
s := 'knight'
Log( '%@', s[1 .. s.length-1] ) // strip first character
 
s = 'socks'
Log( '%@', s[0 .. s.length-2] ) // strip last character
s = 'brooms'
Log( '%@', s[1 .. s.length-2] ) // strip both first and last characters
 
s = 'Δημοτική'
Log( '%@', s[1 .. s.length-2] ) // strip both first and last characters
 
return 0</lang>
 
Output:<pre>
2013-09-04 17:08:09.453 a.out[2257:507] night
2013-09-04 17:08:09.454 a.out[2257:507] sock
2013-09-04 17:08:09.454 a.out[2257:507] room
2013-09-04 17:08:09.455 a.out[2257:507] ημοτικ</pre>
 
=={{header|Erlang}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.