#strings
3 posts tagged strings. Clear filter
-
Extension for Encoding and Decoding Strings in Base64 in Swift
Here is an extension to base 64 encode and decode strings in Swift (3) extension String { func fromBase64() - String? { guard let data = Data(base64Encoded: self) else { return nil } return...
-
A Regular Expression to Generate Dash Separated Slugs AKA Pretty URLs
This regular expression matches non alphanumeric characters in a string. You can use it to create URL friendly slugs. In combination with Stringgsub it will replace the non alphanumeric characters...
-
Yield a Block within Rails Helper Method with Multiple Content_tags Using Concat
To clean up some repetitive html coding in views, pass a block of text to a helper function which will wrap it for you the same way, each and every time. For example, I have a 'help' link which...