Odd word problem: Difference between revisions
m
→{{header|FutureBasic}}: add indents to ReverseString function
(Reverse String function refactored for efficiency) |
m (→{{header|FutureBasic}}: add indents to ReverseString function) |
||
Line 1,015:
local fn ReverseString( string as CFStringRef ) as CFStringRef
NSInteger i, length = len(string)
CFMutableStringRef mutStr = fn MutableStringWithString( string )
for i = 0 to length - 1
CFStringRef chr1 = mid( string, i, 1 )
CFStringRef chr2 = mid( string, length-i-1, 1 )
mid( mutStr, i, 1 ) = chr2
mid( mutStr, length-i-1, 1 ) = chr1
next
end fn = mutStr
|