 
      - returns: the sub string
      */
-    static func substr(string: String, _ start: Int, _ length: Int) -> String? {
+    public static func substr(string: String, _ start: Int, _ length: Int) -> String {
         let startIndex: String.Index?
         if start<0 {
             let l=strlen(string)


// MARK: - global PHP Style String functions

struct PString {

    static func strtoupper(string: String) -> String {
        return string.uppercaseString
    }

    static func strtolower(string: String) -> String {
        return string.lowercaseString
    }

    static func substr(string: String, _ start: Int) -> String? {
        if(start>0) {
            return substr(string, start, string.characters.count)
        } else {
            return substr(string, string.characters.count+start, string.characters.count)
        }
    }

    /**
     Returns a sub string

        return string.substringWithRange(startIndex! ..< endIndex)
    }

    public static func strlen(string: String) -> Int {
        return string.characters.count
    }

    public static func lcfirst(string: String) -> String {
        var tstring=string
        let first=tstring.firstCharacterRange()
        tstring.replaceRange(first, with:tstring.substringWithRange(first).lowercaseString)
        return tstring
    }

    public static func ucfirst(string: String) -> String {
        var tstring=string
        let first=tstring.firstCharacterRange()
        tstring.replaceRange(first, with:tstring.substringWithRange(first).uppercaseString)
