0
votes
2answers
19 views

How to keep spaces where they were after modifying string

So I have to get words from a text file, change them, and put them into a new text file. The problem I'm having is, lets say the first line of the file is hello my name is bob the modified result ...
2
votes
3answers
39 views

How can I convert a string into hex in Java

I'm trying to convert string into hex and decided to use DatatypeConverter.parseHexBinary, it worked in most of cases, but there are some exceptions, like 8f, it's converted into x'3f', instead of ...
1
vote
3answers
71 views

How to replace a 1 or more charceters in string with other characters?

I need to print ......e...... ..e.......... ........e.... .....iAi..... where e is and enemy with a position, so i have replace a dot with ...
2
votes
5answers
37 views

RegEx special char “|” escaping in Java

I am trying to split a string like: abc|aa|| When I use the regular string.split I am required to provide a regular expression. I tried to do the following : string.split("|") ...
-1
votes
1answer
19 views

Java project - override toString() method and return a string

My class has begun working with queues and our instructions are to override the toString() method and return a string. Without using the default method, I do not know how to convert the array into ...
2
votes
3answers
70 views

How to compare VALUE of two strings?

I'm teaching myself how to code with java and I use exercises I find in the Internet to practice what I learn. I am now in a middle of a question that asks me to compare between two strings(input ...
2
votes
1answer
38 views

Java equivalent of php pack('H*', str)

EDIT I changed $checksum = md5($someString+$bkey); to $checksum = md5($someString.$bkey); I need to perform the following operations in Java: $hexString = '90aa';#sample value $bkey = ...
0
votes
0answers
20 views

Convert a String to ByteImage in Qt

I want to convert a string from Java code to Qt, make Qt convert the string to an image and then pass to the Java code. I.e. Java passes the string "John Hanks", Qt converts it to an image with ...
0
votes
1answer
57 views

How to change the first character to a number?

Say if I have a string like String reg = "a1", I need to change the first character of a1 to the number 0 so then it becomes 01 and if the string is c1, it should be 31. What is the best possible way ...
2
votes
3answers
30 views

I need something to look at the characters in a string and accept the string if it only has the certain characters in Java

The statement will return true if the string has these characters in it. "-1234567890". If the string has anything else but these characters the statement will return false. The characters can be in ...
0
votes
2answers
40 views

Using comparator without adding class

I am trying to sort an arraylist by string length, i know of implementing Comparator, but i was wondering if this could be done within my function, without adding any extra classes or methods? Ideally ...
-3
votes
0answers
42 views

Grab certain words from string

I have a string where I would like to grab certain words from Here is the string - [{"minecraft.net":"green"}, ...
0
votes
1answer
44 views

Nothing displayed on TextView after subtracting two times (hh:mm:ss)

I am developing an Android app. I am setting a difference of 2 dates to a TextView. It doesn't display anything. Somewhere, it isn't getting to the TextView. I would love if you could tell me where ...
0
votes
2answers
35 views

Println statements not printing

I have three files in one project and I can't seem to make the println statements in my main class print! Help? First file: package chapter2; public class UseStringLog { public static void ...
-1
votes
1answer
55 views

Java function to output every case possible in a string

I am trying to make a function that outputs every case possible of a string. The function must output each variation of a string and keep a counter for that variation. For example in no particular ...

15 30 50 per page