بســم الله الـرحمــن الرحيــم
السلام عليكــم ورحمـة الله وبركاتــه ،،
أخواني أنا عندي مشكلة في كود البحث (search the word )
وبعد عندي مشكله في الكود بس ما أعرف شو هي بضبط ... يعني جزء من الكود ما يشتغل لما أعرضه على terminal window ؟؟؟؟؟؟؟
هذا الكود مع محاولتي في جزء كود البحث ...
public class StringManipulation
{
public static void main( ){
InputReader reader = new InputReader();
boolean finished = false;
printwelcome();
while(!finished) {
String input = reader.getInput();
if(input.startsWith("bye")) {
finished = true;
}
else {
System.out.println(input);
input=input.trim();
System.out.println(" The input after useing trim() method"+input);
System.out.print("Input a word to check it with our System: ");
String s = reader.getInput();
boolean ok = input.equals(s);
if (ok)System.out.println("The input is equal to "+s);
else System.out.println("The input is not equal to "+s);
input = input.toLowerCase();
System.out.println(" The input after useing toLowerCase method"+input);
String word[] = input.split(" / ");
System.out.println(" THe number of words in the input is = " +word.length);
for (int i=0; i<word.length; i++)
System.out.println(" [" +i+"] "+word);((هذا جزء كود البحث ... انا جربت لما ايدخل اليوزر كلمة معينه الي هي موجودة بين قوسين " hello" يبحث عنها إذا حصلها راح يكتب it is found وإذا لا راح يكتب the system can't find the word ... )) أتمنى إني قدرت أوصل الكم المطلوب ^^
int count = input.length;
for(int i = 0; i < count; i++)
if(input.equals(“ Hello”)) {
System.out.println(“it is found”); break;}
else System.out.println("the system can't find the word ");
}
}
printGoodbye();
}
static void printwelcome()
{
System.out.println("Welcome to the String Manipulation software developing system.");
System.out.println("Please type youe string");
System.out.println(" Please tell us about your problem");
System.out.println("We will mainpulate your String useing string method.");
System.out.println("Please type 'bye' to exit our system.");
}
static void printGoodbye()
{
System.out.println("take care. Bye...");
}
}أتمنــــــــــــــــــــــــــــى المساعدة منكم أخواني
وجزاكم الله كل الخير ان شاء الله
......

