我正在尝试使用 parseInt 方法转换字符串的前两个字符,但我不能。它应该看起来像这样:
String firstChars = IntMessage.substring(0,2);// firstChars is a String that corresponds to the first two characters of the string.
message=ASCII[(Integer.parseInt(firstChar))-32];//The message variable is a String that is supposed to take a firstChars variable and make it an integer so it can be used by the ASCII array in determining which element of the array is to be concatenated to the message String.
例如,如果前两个字符是 98,我想获取该子字符串并将其转换为 int。