string tag

223 questions


2 answers
106 views
0
What is the difference between string object and string in Java?

String str = new String(abc);WowString str = abc;What's the difference?


1 answers
112 views
0
How do I safely remove spaces before and after?

Everything I come up with is a clicheIs there a standard for removing space characters before/after?I hope it's a very standard look good, safe code.

2 years ago

1 answers
102 views
0
What is the best way to repeat a string in Java?

Is there any other way to change the string to char[] by turning the repetitive statement instead of StringTokenizer?


1 answers
101 views
0
Why is it "a"! = "a"?

void main() { if(a == a) printf(Yes, equal); else printf(No, not equal);}Output: No, not equal I thought it would be true because the two of them are the same string, but why did the false appear?

2 years ago

1 answers
127 views
0
I want to replace characters in a specific index of a string.

To replace characters in a specific index in a string String myName = domanokz;myName.charAt(4) = 'x';I tried this way, but an error occurred. Is there another method?


1 answers
115 views
0
How do I add a new element to an array?

String[] where;where.append(ContactsContract.Contacts.HAS_PHONE_NUMBER + =1);where.append(ContactsContract.Contacts.IN_VISIBLE_GROUP + =1);I tried this way to add elements to the String array, but it ...

2 years ago

1 answers
99 views
0
To clear a line break from a file

How do I get rid of all line breaks when I read a text file in Java? String text = readFileAsString(textfile.txt);text.replace(\n, );I tried it like this, but it didn't work.


1 answers
117 views
0
I'd like to add a space on the right according to the length when printing.

To fill in the first 0: >>> print '%06d'%4'000004'This is what I know'hi 'How do I add spaces back together? str+*number I know we can write together.


1 answers
98 views
0
What is the most Python way to check if a string starts with a particular string?

When I try to figure out if the string starts with hello, I usually use a slicerI wonder if there is an easier way than this.mystring = hello python world!if mystring[:len(hello)] == hello: print(yes!...


1 answers
78 views
0
How to change the color integer value to hex String on Android

An integer value was generated in android.graphics.Color. The integer value is -16776961.I'd like to change this value to #RRGGBB format for hexString. How shall I do it?For example, I want to change ...

2 years ago
« - 4 - »

© 2024 OneMinuteCode. All rights reserved.