Tagged Questions
0
votes
4answers
26 views
Java - Error Message: 'Cannot Convert from void to String
I am creating a simple console applet for an assignment and I have ran into an error when trying to run my app. The error is:
'Type mismatch: cannot convert from void to String'.
The error occurs ...
0
votes
4answers
41 views
compare strings method
I would like to compare strings but the following code won't work. I'm guessing it's because incompatible, is there any other way to do it?Thanks!
public class test
{
public static void ...
0
votes
1answer
21 views
How can i get Date, Month and Year from a user input string eg 25/03/2012
Im struggling to break a String representing a date into the individual elements date, month, year. As currently i have a user input the date as a string. scan.nextLine()
I would like to be able to ...
0
votes
3answers
37 views
Why does this display the output infinitely / many times?
This program below when run does not halt. I don't think I made a major error but please help me for I'm new in Java.
import java.util.*;
public class ReverseWords {
public static void ...
0
votes
2answers
67 views
Inversing a String
The program below should do this:
When the user input: The quick brown fox. Jumps over. The lazy dog.
It should output: God yzal eth. Revo spmuj. Xof nworb kciuq eht.
But instead when the user ...
1
vote
1answer
52 views
java - split string according to delimiter but only outside parenthesis?
I want to split string according to delimiter but only outside parenthesis.
Is there any library (built-in or not) that does so?
Example:
If delimiter is ":" then:
string "a:b:c" should be split to ...
-1
votes
1answer
27 views
Android final variable error
When i write this code i see this error.
i see "The final local variable peyvaDawi cannot be assigned, since it is defined in an enclosing type" in marked line.
public void onCreate(Bundle ...
0
votes
3answers
49 views
Java how to setup regex for this string
So I'm trying to pull two strings via a matcher object from one string that is stored in my online databases.
Each string appears after s:64: and is in quotations
Example s:64:"stringhere"
I'm ...
1
vote
3answers
80 views
Concatenating Strings in Java [closed]
Possible Duplicate:
Why does + work with Strings in Java?
The following statements are valid in Java.
int a=50;
String tmp="a = ";
String b=tmp+a;
b of type String now contains a = 50 ...
-4
votes
2answers
62 views
An equivalent of the String.replace method in Java. [closed]
Okay the reason this sounds like a homework assignment is because well it is one :( Below is a sample of what I've come up with but I dont know why it wont work for the example given in the method ...
0
votes
1answer
49 views
Convert foreign characthers (Greek) to English ones.
I am installing alarms, but they have an interface that I have to give name to various zones. The problem is that they can only accept greek characters that does not exist in english language else ...
0
votes
1answer
36 views
How can i add textfields to an actionlistener of a button in java swing? i have a query regarding strings as well
public class BasicGuiOnlyText extends JPanel{
static String outputHtml="<html>";*>Creating The String*
private JFrame f = new JFrame("Static Web Page Builder"); *>Creating the Frame*
...
1
vote
3answers
43 views
Java Replace Character At Specific Position Of String?
I am trying to replace a character at a specific position of a string.
For example:
String str = "hi";
replace string position #2 (i) to another letter "k"
How would I do this?
Thanks!
0
votes
2answers
76 views
Formatted string parsing
I'm calling a web service that returns the following string:
anyType{x=4;y=5;z=acq}
How do you get the values of x, y and z?
0
votes
6answers
62 views
How to compare strings to get missing word?
I have created a table and some buttons to remove/add rows.
Problem is, when I add a new row, I must insert a value in the field name which isn't already on that table. Let me explain.
Here is the ...