<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[ItsMods - Java, HTML, PHP]]></title>
		<link>https://www.itsmods.com/</link>
		<description><![CDATA[ItsMods - https://www.itsmods.com]]></description>
		<pubDate>Sat, 24 Oct 2026 09:45:21 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[WordFilter]]></title>
			<link>https://www.itsmods.com/Thread-WordFilter.html</link>
			<pubDate>Thu, 24 Apr 2014 22:27:11 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://www.itsmods.com/member.php?action=profile&uid=9445">ScHmIdTy56789</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.itsmods.com/Thread-WordFilter.html</guid>
			<description><![CDATA[Sup fellas,<br />
Its been awhile lol. Hows everybody doin? <br />
<br />
Im living the dream! finishing my first year of college, getting all my finals done (feelsGoodMan.jpeg). <br />
<br />
lol anyways, since ive been dominating my java class, 98% <img src="https://www.itsmods.com/images/smilies/fuckyea.png" alt="Fuck yea!" title="Fuck yea!" class="smilie smilie_23" />, I wanted to create a program from scratch. WHICH IVE DONE SO FAR!<br />
<br />
its a word filter (obviously). Ive only been able to find the spaces. Im stuck at this moment. I need some help from you fellers. <br />
<br />
Driver:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>package WordFilter;

/**
 *
 * @author Josh
 */
public class Driver {
    public static void main(String[] args)
    {
        Filter filter = new Filter();
        filter.buildSentence();
        filter.removeWords();
    }
}</code></div></div><br />
Filter:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>package WordFilter;

import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author Josh
 */
public class Filter {
    private String sentence;
    
    public Filter()
    {
        this.sentence = new String();
    }
    
     /**
     * lets the user enter a sentence then assigns it to a variable
     */
    public void buildSentence() {
        Scanner in = new Scanner(System.in);
        
        System.out.println("Please enter a sentence to remove the badwords:");
        sentence = in.nextLine();
    }
    
    /**
     * Removes the bad words from the sentence variable
     */
    public void removeWords() {
        String[] badArray;
        badArray = new String[2];
        badArray[0] = "fuck";
        badArray[1] = "shit";
        
        toArray(sentence, badArray);
        
        /*for(int i = 0; i &lt; badArray.length; i++)
        {
        
        }*/
    }
    
    public void toArray(String sentence, String[] inArray)
    {
        int counter = 0;
        ArrayList spaceCounter = new ArrayList();
        String word = "";
        while(!(counter == sentence.length()))
        {
            for(int i = 0; i &lt; sentence.length(); i++)
            {
                if(sentence.charAt(i) == ' '){
                    spaceCounter.add(i);
                }   
                counter++;
            }
        }
        for(int j = 0; j &lt; spaceCounter.size(); j++){
            System.out.println(spaceCounter.get(j));
        }

    }
}</code></div></div><br />
Should I use a for loop to look between each space given in the ArrayList to check and see if it matches a bad word? or am I making this to complicated? lol]]></description>
			<content:encoded><![CDATA[Sup fellas,<br />
Its been awhile lol. Hows everybody doin? <br />
<br />
Im living the dream! finishing my first year of college, getting all my finals done (feelsGoodMan.jpeg). <br />
<br />
lol anyways, since ive been dominating my java class, 98% <img src="https://www.itsmods.com/images/smilies/fuckyea.png" alt="Fuck yea!" title="Fuck yea!" class="smilie smilie_23" />, I wanted to create a program from scratch. WHICH IVE DONE SO FAR!<br />
<br />
its a word filter (obviously). Ive only been able to find the spaces. Im stuck at this moment. I need some help from you fellers. <br />
<br />
Driver:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>package WordFilter;

/**
 *
 * @author Josh
 */
public class Driver {
    public static void main(String[] args)
    {
        Filter filter = new Filter();
        filter.buildSentence();
        filter.removeWords();
    }
}</code></div></div><br />
Filter:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>package WordFilter;

import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author Josh
 */
public class Filter {
    private String sentence;
    
    public Filter()
    {
        this.sentence = new String();
    }
    
     /**
     * lets the user enter a sentence then assigns it to a variable
     */
    public void buildSentence() {
        Scanner in = new Scanner(System.in);
        
        System.out.println("Please enter a sentence to remove the badwords:");
        sentence = in.nextLine();
    }
    
    /**
     * Removes the bad words from the sentence variable
     */
    public void removeWords() {
        String[] badArray;
        badArray = new String[2];
        badArray[0] = "fuck";
        badArray[1] = "shit";
        
        toArray(sentence, badArray);
        
        /*for(int i = 0; i &lt; badArray.length; i++)
        {
        
        }*/
    }
    
    public void toArray(String sentence, String[] inArray)
    {
        int counter = 0;
        ArrayList spaceCounter = new ArrayList();
        String word = "";
        while(!(counter == sentence.length()))
        {
            for(int i = 0; i &lt; sentence.length(); i++)
            {
                if(sentence.charAt(i) == ' '){
                    spaceCounter.add(i);
                }   
                counter++;
            }
        }
        for(int j = 0; j &lt; spaceCounter.size(); j++){
            System.out.println(spaceCounter.get(j));
        }

    }
}</code></div></div><br />
Should I use a for loop to look between each space given in the ArrayList to check and see if it matches a bad word? or am I making this to complicated? lol]]></content:encoded>
		</item>
	</channel>
</rss>