I have a Swift app that is scanning a barcode. The barcode sometimes contains a control character at the beginning which is not visible: \u{1D}
I use this method to strip the value from the string but I am looking for something more robust in case some other control characters come up or are inside the string and not at the beginning.
if(articleFilter.hasPrefix("\u{1D}")){
let stringSize = articleFilter.count - 6
finalArticleCode = String(articleFilter.suffix(stringSize))
}