I need to write a loop to go through a string and retrieve alternate characters from index positions. Then append the characters to another string and then print (eg. "pleasehelp" = "peshl")

I have hit a wall and lack any sort of know how to push through... what have I got myself into? All I have is below.

string sentence = "please help";

char[] charSentence = sentence.toCharArray();

for (sentence);

string sentence = "please help";
char[] charSentence = sentence.toCharArray();
StringBuilder builder = new StringBuilder();
for (int i = 0; i < charSentence.length; i += 2) {
    builder.Append(charSentence[i]);
}
println(builder.toString());
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.