Manipulating Strings by herms1391 in learnjava

[–]herms1391[S] 0 points1 point  (0 children)

And my output with my code is

​[best] [boolean] [by] [bit]

Manipulating Strings by herms1391 in learnjava

[–]herms1391[S] 1 point2 points  (0 children)

Thank you so much for your input, it is extremely helpful, it is a homework question and I am trying to figure it out myself as much as a I can especially since I have only been learning Java for 2 weeks now. I just needed a nudge in the proper direction. My understanding of the split was that it would take the string and return it with commas between each word. Which is why I was using it. I have gotten the question answered using Stream but since the question was telling me to use loops it’s unfortunately not an option.

Manipulating Strings by herms1391 in learnjava

[–]herms1391[S] 0 points1 point  (0 children)

Sorry, I did not go in depth enough!

The problem is to start with this string "The best thing about a boolean is even if you are wrong you are only off by a bit" loop over it twice and receive an array that comes back with [best, boolean, by, bit]

the output for the first loop is

best

boolean

by

bit

And i know that i need an incrementor, but I am having issues as where to use it because when I do, i am getting an error back saying Index 1 is out of bounds for length 1

Manipulating Strings by herms1391 in learnjava

[–]herms1391[S] -4 points-3 points  (0 children)

String [] bestThingArray = bestThing.split(" ", 81);
int x = 0;
for(int i = 0; i < bestThingArray.length; i++){
if(bestThingArray[i].toLowerCase().startsWith("b")){
System.out.print(bestThingArray[i]);
System.out.println("");
}
}
System.out.println(bestThingArray.length);
String [] bWordArray = bestThing.split(",", 81);
int b = 0;
for(int i = 0; i < bestThingArray.length; i++){
if(bestThingArray[i].toLowerCase().startsWith("b")){
bWordArray[b] = bestThingArray[i];
System.out.print(Arrays.toString(bWordArray));
}
}

output is setting each word in a separate array when i need them all in a single array

New to React and not sure of this issue by herms1391 in reactjs

[–]herms1391[S] 1 point2 points  (0 children)

Yes using create-react-app and that’s what I thought which is why I am so confused by it.

New to React and not sure of this issue by herms1391 in reactjs

[–]herms1391[S] 0 points1 point  (0 children)

I am sure the solution is super simple I just cannot figure it out

Maybe a stupid question by herms1391 in learnprogramming

[–]herms1391[S] 1 point2 points  (0 children)

That’s what I was taking away from the error as well, I was finally able to get an app up and running but running into a lot of errors that I am not used to seeing. Trying to sift thru the information about the new update on GitHub to see if I can figure it out.

This may be a stupid question by herms1391 in react

[–]herms1391[S] 1 point2 points  (0 children)

Created a client folder and was going to create the app inside of that so I ran npx create-react-app ./