Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: Array

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1


    I want to do a translation on a sentence that a user types in, then translate it to other language
    I got a database of words translation.
    But i don't know how to do an array.
    if ic an store all the string from the user input, and store it in an array, i can use a loop to translate each words and print them all as a sentence in another language.
    any idea?
    Thank you

  2. #2
    Just Joined!
    Join Date
    Apr 2003
    Australia & England
    What language are you using?
    There are a million tutorials on the net explaining how arrays work for whatever language, but they are generally all the same. I'll do a java example. Are you also sure you want arrays, or are you happy with a collection API?
    String[] wordList = {"hello", "mr", "jones"};
    StringBuffer translatedSentance = new StringBuffer(100);
    for &#40;int i = 0; i < wordList.length; i++&#41; &#123;
            String translatedWord = wordList&#91;i&#93;;
            translatedSentance. append&#40;translatedWord&#41;;

  3. #3
    nonono, i'm trying to write a shell program to translate anEnglish sentence into French, i got the french dicionary called, but how do i set an array to store all the words inside a sentence that the users puts in and then use a lopp to translate them all?

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts