I am using shared server with a php script that sends a number to my application. The server like to mess with me by adding an invisible ‘ to that number. I’ve been trying for around 6 hours fix this but there is no way for me to access the ‘. As soon as I convert the number(string form) to a real number it give an error that say the number looks like this: ‘200. You can never see the ‘ in logcat, only if the error occurs. If I log the string’s length, it counts one more character than there should be. It works when I test it localy on my computer but when I upload it to the shared server it adds the ‘. Do anyone know why this is happening? Also is there any method to convert a string with a ‘ in it to a number without using any string manipulation methods since there is no way to access the ‘ ?
Share
Try trimming the string before converting: