The overall goal of this entire program is to overwrite the old badStr with the goodStr, regardless of what length the strings are. The overwritten badStr is the fixed version that of the badStr, and...
Type: Posts; User: SamJava_the_Hut
The overall goal of this entire program is to overwrite the old badStr with the goodStr, regardless of what length the strings are. The overwritten badStr is the fixed version that of the badStr, and...
Norm, I am getting way closer! The IndexOutOfBoundsException problem is gone. Below is my updated code:
FixString.java
package samsExperiments;
import java.util.Scanner;
import...
I'm now trying to fix my bad string with array lists instead of regular arrays. If I use regular arrays, the program crashes with an array out of bounds error if the badStr and goodStr strings are...
It works! Thanks Norm:
public static String fixBadStr(char[] badStrToChars, char[] goodStrToChars) {
for(int i = 0; i < badStrToChars.length; i++) {
if(badStrToChars[i] !=...
Hi, I'm trying to fix a string from "hollo werld" to "hello world". To do this, I made another string of what we want, turned both of them into char arrays, and iterated through, changing elements as...