Tag Archives: string

(Bash) Search for string in files

 

Posted in Bash | Also tagged , , , | Leave a comment

(Haskell) Radix Conversion

Converts an integer from base 10 to a string of base x (where 0 > x >= 20). The only thing I’d improve is getting rid of all the calls to error. Perhaps hand back a Maybe String that simply hands back Nothing if unable to convert the number.

Posted in Haskell | Also tagged , , , , | Leave a comment

(Python) Statistical String Comparison

http://docs.python.org/library/difflib.html

Posted in Python | Also tagged , , , , | Leave a comment

String matching and comparison in Objective-C (Cocoa Framework)

This snippet shows how to search for a string within another string and how to check if two strings are equal. NSString* needle = @”hello”; NSString* haystack = @”hello world”; NSRange matching = [haystack rangeOfString : needle]; // Searching for a string within another string if(matching.location == NSNotFound){ // Needle not found in haystack } [...]

Posted in Objective-C | Also tagged , , , , | Leave a comment