Can anyone tell me what im doing wrong here ? I just want to detect the last word of the sentence and if not found to show "Not found." here is the code: String[] items = { "Iphone", "Computer", "Car" }; String field = Field.getText(); String text = "I want a "; Scanner scan = new Scanner(text); for (int i = 0; i < text.length(); i++) { while (scan.hasNext()) { String next = scan.next(); for (int j = 0; j < items.length; j++) { if (next.equals(items[j])) { infoLabel.setText("You want a: "+items[j]); } else { infoLabel.setText("Item not found."); } } } …

Member Avatar
Member Avatar
+0 forum 9

Dim temp As Translator Using sr As IO.StreamReader = New IO.StreamReader("text.dll") For i As Integer = 0 To 15 trans(i).english = sr.ReadLine trans(i).arabic = sr.ReadLine Next For i As Integer = 1 To 15 For j As Integer = 1 To 16 - i If trans(j - 1).english > trans(j).english Then temp = trans(j - 1) trans(j - 1) = trans(j) trans(j) = temp End If Next Next Do While (True) Dim line As String = sr.ReadLine If line Is Nothing Then Exit Do End If Dim words As String() = line.Split("|") Dim word As String For Each word In …

Member Avatar
Member Avatar
+0 forum 12

Hello, I need a litle help here. I am creating a program that finds a specific sentence in a word path and replaces it with a given value. Specific sentence: l="600" And it has to be changed to : l="300" This is not to dificult and works fine: Public Class Form1 Private Property sign As String Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim sign1 As String Dim sign2 As String sign1 = ("""600""") 'sign1 = ("""") sign2 = ("""300""") Dim source As String = "C:\temp\bodem.mpr" 'path from original file Dim destination As String = "C:\temp\bodem2.mpr" 'path …

Member Avatar
Member Avatar
+0 forum 6

How to print a sentence (including white spaces) from a file ? Or How to print entire text file which has a paragraph? I have tried a lot and the final programs is shown below.. but it can't print sentences exceeding certain length... it shows unwanted ASCII characters :( How to overcome this problem? #include<iostream.h> #include<fstream.h> #include<iomanip.h> int main() { char msg[100]; ofstream ofile("Helloworld.txt"); cout<<"Enter a sentence: "; cin.getline(msg,100); ofile<<msg; ofile.close(); ifstream ifile("Helloworld.txt"); cout<<"File contents:\n\n\n"; ifile>>msg; cout.write(msg,30); return 0; }

Member Avatar
Member Avatar
+0 forum 5

hello everyone I really need help so I have to make functions that find vowels, digits and uppercase and lowercase letters from a sentence inputted. So i was able to do it all in main but i cant seem to make the new program work with the functions properly, it says on the compiler that it has no errors but ones i debug it, it shoes the wrong answers. would really appreciate the help. this is what i have so far with the functions #include <iostream> #include <cctype> #include <string> #include <iomanip> #include <algorithm> using namespace std; int findUpper(char ch); …

Member Avatar
Member Avatar
+0 forum 2

This is a goofy sentence generator I have made in python; it took about 5 minutes to get the code to work - but its working now so if your curious try it out!

Member Avatar
Member Avatar
-1 forum 3

Hello, Please advise how to remove white spaces before and after a sentence only. Example: " This is a sentence. " should be "This is a sentence." Thanks.

Member Avatar
Member Avatar
+0 forum 3

I need any Open Source Sentence Grammar Corrector for one of my projects. I searched it on Google but couldn't find any. All the results coming link to only Grammar Checker tools only not grammar corrector. Please suggest me any open source tool which can correct the grammar also or suggest me any idea that how can I implement it.

Member Avatar
Member Avatar
+0 forum 2

Hello i want to the textbox that when I start to type in names it should be like this [B]Camille Aisha Cordova[/B] How do I do this?

Member Avatar
Member Avatar
+0 forum 16

This is my code for anagrams not utilizing the ready prepared file of anagram synonyms to celebrate 11.11.11 11:11:11. If you start program it warns you about missing subdirectory dict and creates it. You may put any word files, one word per line, to file <dictionary name>.txt. Program lists available directories if started in interactive prompt mode by not supplying parameters from command line. Few usefull dictionary locations mentioned also in code: [url]http://wordlist.sourceforge.net/[/url] [url]http://www.isc.ro/en/commands/lists.html[/url]

Member Avatar
+0 forum 0

The End.