java 从字符串的特定位置获取特定字符

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 从字符串的特定位置获取特定字符相关的知识,希望对你有一定的参考价值。

//charAt method will pick the specific character of the string of position number of j

for (int j = 0; j < halfString.length(); j += 2) {
    char finalOutPutChar = halfString.charAt(j);
    finalOutPut = finalOutPut + finalOutPutChar;
}

以上是关于java 从字符串的特定位置获取特定字符的主要内容,如果未能解决你的问题,请参考以下文章