• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Too many letters in Alphabet List & Suggestion for creating Setlists
#7
The problem is that on Android and Windows, I believe the string trimming methods already do that - they remove characters below a space. With Swift on iPadOS, strings are implemented in an incredibly different fashion, so while I have used the built-in capabilities to remove whitespace and newlines, it doesn't seem as straightforward to take a character from a string (which may be represented with multiple scalar values) and compare it against a space in an "integer-like" fashion. There may be a way to do this properly, but I'm worried about hacking together a solution that may have errors or unintended effects when dealing with characters like emojis. It may be something like 

while str.count > 0 && str.charAt(0).isAscii && str.charAt(0).asciiValue < 32 {
   str = str.substring(1)
}

or something to that effect, but I would need to do a lot of testing to verify this works in every situation first. I tested it with some simple cases and it does appear to work properly though.

Mike
Reply


Messages In This Thread
RE: Too many letters in Alphabet List & Suggestion for creating Setlists - by Zubersoft - 06-26-2023, 05:52 AM



Users browsing this thread:
4 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.