string tag

223 questions


1 answers
119 views
0
Splitting strings in Java

There is a string called 004-034556, separated by '-' string1=004;string2=034556;I want to split it like this. So I want to find '-' and make an exception if there is none, what should I do?

2 years ago

1 answers
128 views
0
Can getStackTrace() return value be String?

Can getStackTrace()return value be made into String

2 years ago

1 answers
99 views
0
I want to read the file line by line and save it to the array

It's exactly what it says.File is hello C world!hello python world!If I say I have it like thisa[0] = 'hello C world!'a[1] = 'hello python world!'I want to make it come out like thisYo

2 years ago

1 answers
130 views
0
Replace String with Date in Java

If there is a string format like January 2, 2010, I want to know how to change it to Date typeI want to split that string into years, months, and days

2 years ago

1 answers
122 views
0
Find a specific word location in a string

Is there a method like java's contents or indexOf?I'm going to write it like this.if not somestring.contains (String to Find): continue


1 answers
91 views
0
Counting Characters in a String

I'd like to count how many specific characters appear in the string.What's the easiest way?ex)mystring = aaabccWhen a->3b->1c->2

2 years ago

1 answers
64 views
0
When switching int to String in Java, which is better, Integer.toString(i) or new Integer(i).toString()?

Someone asked me a question, and when I initialized a large amount of int,What's the difference if you have?

2 years ago

1 answers
120 views
0
concat() and + operator when linking strings

If you have the string a, b in Java, you can connect ita+=ba.concat(b)There's a way like this. Are these two the same? I have the code for the concat method, but there is no code for + operator. Pleas...

2 years ago

1 answers
139 views
0
Why does String's hashCode() use 31 to multiply?

In Java, the hash code for the String object is s[0]*31n-1 + s[1]*31n-2 + ... + s[n-1] is calculated like this. To illustrate the above equation, s[i] is the ith character in the string, n is the leng...

2 years ago

1 answers
125 views
0
I want to change it to a string without any unnecessary parts such as zero below the decimal point when I print out the real number, what should I do?

On 64-bit operating systems, double represents up to +-253. Until 53I'm using double because I think the size of the number I'm expressing is about unsigned 32-bit Integer. The problem is that even if...

« - 2 - »

© 2024 OneMinuteCode. All rights reserved.