Does String.prefix() work like String.suffix() if using a right-to-left language? That is instead of returning the left side of the string it returns the right side.
Nope, their functionality doesn't change. Right-to-left only matters when you're displaying any text to the user, for example in a UITextField
. The String
s you access in your code are independent of the writing direction.