Jump to content

Balanced brackets: Difference between revisions

m
Fixed bug
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag)
m (Fixed bug)
Line 3,335:
include "NSLog.incl"
 
local fn BracketBalance( strWithBracketsstrWithBracket as CFStringRef ) as CFStringRef
NSInteger i, bracketTracker = 0
CFStringRef result
Line 3,341:
CFCharacterSetRef bracketSet = fn CharacterSetWithCharactersInString( @"[]" )
CFCharacterSetRef bracketsOnlySet = fn CharacterSetInvertedSet( bracketSet )
CFStringRefCFArrayRef trimmedStr trimmedSArray = fn StringByTrimmingCharactersInSetStringComponentsSeparatedByCharactersInSet( strWithBracketsstrWithBracket, bracketsOnlySet )
CFStringRef trimmedStr = fn ArrayComponentsJoinedByString( trimmedSArray, @"" )
NSUInteger strLen = len( trimmedStr )
723

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.