<commit_before>//
//  String+Additions.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 29/12/14.
//  Copyright (c) 2014 com.mercadopago. All rights reserved.
//

import Foundation

extension String {
	
    static let NON_BREAKING_LINE_SPACE = "\u{00a0}"
    
	var localized: String {
		var bundle : Bundle? = MercadoPago.getBundle()
		if bundle == nil {
			bundle = Bundle.main
		}
        let currentLanguage = MercadoPagoContext.getLanguage()
        let path = bundle!.path(forResource: currentLanguage, ofType : "lproj")
        let languageBundle = Bundle(path : path!)
        return languageBundle!.localizedString(forKey: self, value : "", table : nil)
	}
	
    public func existsLocalized() -> Bool {
        let localizedString = self.localized
        return localizedString != self
    }
    
    static public func isNullOrEmpty(_ value: String?) -> Bool
    {
        return value == nil || value!.isEmpty
    }
    
    static public func isDigitsOnly(_ a: String) -> Bool {
		if Regex.init("^[0-9]*$").test(a) {
			return true
		} else {
			return false
		}
    }
    
    public func startsWith(_ prefix : String) -> Bool {
        if prefix == self {
            return true
        }
        let startIndex = self.range(of: prefix)
        if startIndex == nil  || self.startIndex != startIndex?.lowerBound {
            return false
        }
        return true
    }
    
    subscript (i: Int) -> String {
        
        if self.characters.count > i {
            return String(self[self.characters.index(self.startIndex, offsetBy: i)])
        }
        
        return ""
    }
    
    
    public func lastCharacters(number: Int) -> String {
        print("El string es \(self)")
        let trimmedString: String = (self as NSString).substring(from: max(self.characters.count - number,0))
        print(trimmedString)
        return trimmedString
    }
    
    public func indexAt(_ theInt:Int)->String.Index {
        
        return self.characters.index(self.characters.startIndex, offsetBy: theInt)
    }
    
    public func trimSpaces()-> String {
        
        var stringTrimmed = self.replacingOccurrences(of: " ", with: "")
        stringTrimmed = stringTrimmed.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
        return stringTrimmed
    }
}
<commit_msg>Remove print<commit_after>//
//  String+Additions.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 29/12/14.
//  Copyright (c) 2014 com.mercadopago. All rights reserved.
//

import Foundation

extension String {
	
    static let NON_BREAKING_LINE_SPACE = "\u{00a0}"
    
	var localized: String {
		var bundle : Bundle? = MercadoPago.getBundle()
		if bundle == nil {
			bundle = Bundle.main
		}
        let currentLanguage = MercadoPagoContext.getLanguage()
        let path = bundle!.path(forResource: currentLanguage, ofType : "lproj")
        let languageBundle = Bundle(path : path!)
        return languageBundle!.localizedString(forKey: self, value : "", table : nil)
	}
	
    public func existsLocalized() -> Bool {
        let localizedString = self.localized
        return localizedString != self
    }
    
    static public func isNullOrEmpty(_ value: String?) -> Bool
    {
        return value == nil || value!.isEmpty
    }
    
    static public func isDigitsOnly(_ a: String) -> Bool {
		if Regex.init("^[0-9]*$").test(a) {
			return true
		} else {
			return false
		}
    }
    
    public func startsWith(_ prefix : String) -> Bool {
        if prefix == self {
            return true
        }
        let startIndex = self.range(of: prefix)
        if startIndex == nil  || self.startIndex != startIndex?.lowerBound {
            return false
        }
        return true
    }
    
    subscript (i: Int) -> String {
        
        if self.characters.count > i {
            return String(self[self.characters.index(self.startIndex, offsetBy: i)])
        }
        
        return ""
    }
    
    
    public func lastCharacters(number: Int) -> String {
        print("El string es \(self)")
        let trimmedString: String = (self as NSString).substring(from: max(self.characters.count - number,0))
        return trimmedString
    }
    
    public func indexAt(_ theInt:Int)->String.Index {
        
        return self.characters.index(self.characters.startIndex, offsetBy: theInt)
    }
    
    public func trimSpaces()-> String {
        
        var stringTrimmed = self.replacingOccurrences(of: " ", with: "")
        stringTrimmed = stringTrimmed.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
        return stringTrimmed
    }
}

{'fraction_non_alphanumeric': 0.10894097222222222, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 2.225332400279916, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2885949', 'n_tokens_mistral': 1450, 'n_tokens_neox': 1345, 'n_words': 332}