java - Unique Characters -
i working on project class. have find number of unique hashtags in tweet input java. relatively new coding, stuck how find out unique hashtags. far, have scanner.
package edu.bsu.cs121.jmgibson; import java.util.arraylist; import java.util.list; import java.util.scanner; public class hashtag { public static void main(string args[]) { arraylist<string> hashtag = new arraylist<string>(); scanner tweet = new scanner(system.in); while (true) { system.out.println("please enter name: "); hashtag.add(tweet.next()); } } }
here link usage of scanner:
http://docs.oracle.com/javase/7/docs/api/java/util/scanner.html
you firstly want identify how create needed delimiter. there example in link, looking substring begins # , ends whitespace. since homework assignment exact answer cannot given - however, custom delimiter need be.
Comments
Post a Comment