Do you need help on a specific subject? Use the contact form (Request a blog entry) on the right hand side.

2015-05-29

Update: String extensions

The post that contains String extensions has been updated.

It now includes the new functions:

    /// Returns true if the character at the given index is a lowercase character as defined in the lowercase character set. Works for UTF16 characters only.
    
    func isLowercaseCharacterAtIndex(index: String.Index) -> Bool {...}
    
    
    /// Returns true if the character at the given index is an uppercase character as defined in the lowercase character set. Works for UTF16 characters only.

    func isUppercaseCharacterAtIndex(index: String.Index) -> Bool {...}

    
    /// Replaces the character at the specified index with the given character. Returns true if the string was changed, false if not.
    
    mutating func replaceCharacterAtIndex(index: String.Index, with char: Character) -> Bool {...}
    
    
    /// Changes the case of the character at the specified index if the character is a member of either the lowercase character set or the uppercase character set. Returns true if the string was changed, false if not.
    

    mutating func changeCaseOfCharacterAtIndex(index: String.Index) -> Bool {...}


Note that while these functions only work for UTF16 characters, the String they work on may contain  other characters as well.

Happy coding...

Did this help?, then please help out a small independent.
If you decide that you want to make a small donation, you can do so by clicking this
link: a cup of coffee ($2) or use the popup on the right hand side for different amounts.
Payments will be processed by PayPal, receiver will be sales at balancingrock dot nl
Bitcoins will be gladly accepted at: 1GacSREBxPy1yskLMc9de2nofNv2SNdwqH

We don't get the world we wish for... we get the world we pay for.

No comments:

Post a Comment