0
votes
1answer
19 views

Why isn't my string being displayed in the window?

I am trying to create a simple application that shows a red circle that when clicked displays different messages under it. I believe that this part of the code: g.drawString("DO NOT PRESS", 100, ...
5
votes
2answers
43 views

Algorithm and Data Structure for Checking letters in a word with another set of letters

I have a dictionary of 200,000 words and a set of letters. I need an algorithm to check if all the letters of a word are in that set of letters. It's very slow to check the words one by one. Because ...
1
vote
2answers
56 views

I need to extract numbers from a String in Java

In my program, I need to extract numbers from a String the given string is the following. String numberOfHours = "12.0 8.0 7.0 7.0 10.0 8.0 0.0 2.0"; I need to extract each value into an ...
0
votes
2answers
53 views

Combining array indexes

I have created two arrays. One to store names and one to store sales. I am trying to link the indexes of each together so that index 1 from then name array will bring up the value of index 1 of the ...
0
votes
4answers
44 views

Java string.replace(old, new) count how many replaced?

I have my console (image down below), and I have a command that will replace all oldstinrg to newstring. But how do I count how many of those were replaced? (If the code replaced only once a to b ...
0
votes
4answers
23 views

The method getLong(String, long) in the type SharedPreferences is not applicable for the arguments (String)

I'm getting an error message stating "The method getLong(String, long) in the type SharedPreferences is not applicable for the arguments (String)" on the line (all the way at the end of my code): ...
0
votes
5answers
43 views

Get Specific URL from the Text/String Using Java

I'm newbie to Java, I want to get all of the URL in the text below WEBSITE1 https://localhost:8080/admin/index.php?page=home WEBSITE2 https://192.168.0.3:8084/index.php WEBSITE3 ...
1
vote
4answers
58 views

How to take parts from string in Java?

I have a small program like a console that allows input of commands trough JTextField. I have a lot of commands written in with input being converted to a string > and if a command has like ping an ...
4
votes
6answers
57 views

Creating string with escape java

I have the following problem, I have a string array like that String[] myArray = {"AAAA","BBBB","CCCC"}; and my purpose is to create another array like that String myNewArray = ...
0
votes
0answers
7 views

UVA Closests Sums wrong answer

The problem I am refering to is this problem. I've been trying over and over and I keep on getting wrong answer. Every test input I try comes out with the same output that the uvatoolkit outputs. The ...
2
votes
3answers
50 views

java regexp match morse code

I'm trying to test if the Morse code is legal. public static boolean isMorseCode( String code ){ return code.trim().matches("[+.|+\s|+-]"); } The Morse code line can begin with a . (known as ...
-1
votes
4answers
65 views

Compare a text file line by line with a dynamic variable

I have a text file sample.txt which have following lines sample1.txt test.ppt example.doc content.pdf I have a dynamic variable called field (example phpcookbook.pdf,sample1.txt) it should compare ...
0
votes
1answer
52 views

Why while defining String in java, being a class, we do not use new? [duplicate]

Why while defining String in java, being a class, we do not use new keyword? We use it as: String a="Hello"; Classes in Java are defined as: Class1 obj = new Class1;
0
votes
5answers
57 views

Replacing multiple char from a string in java

I have a PHP script <?=str_replace(array('(',')','-',' ','.'), "", $rs["hq_tel"])?> this is a string replace function that take array of chars and replace them if find any of the char in string. ...
0
votes
3answers
56 views

count number of certain value occurances in a string

I have a string which contains my mail details such as GitHub Sat Jun 01 13:32:02 IST 2013 eBay Mon Jun 03 17:37:40 IST 2013 YouTube Tue Jun 04 00:18:50 IST 2013 YouTube Sat Jun 08 01:20:47 ...

1 2 3 4 5 494
15 30 50 per page