Change only one character from the String type string to uppercase

StringBuilder str = new StringBuilder(); 
str.append("abcdef");
str.setCharAt(3, Character.toUpperCase(str.charAt(3)));

Output result: abcDef

There may be a better way ...

Recommended Posts

Change only one character from the String type string to uppercase
[Convenient to remember !!!] How to convert from LocalDate type to character string and from character string to LocalDate type
[Java] How to convert from String to Path type and get the path
[Swift] Copy the character string to the clipboard
Deletes after the specified character from the character string
Type conversion from java BigDecimal type to String type
[Ruby] I want to output only the odd-numbered characters in the character string
I want to find out what character the character string appears from the left
Convert from C String pointer to Swift String type
I want to get only the time from Time type data ...! [Strftime] * Additional notes
[Java] How to erase a specific character from a character string
I want to output the character number from the left where an arbitrary character string appears.
# 1_JAVA I want to get the index number by specifying one character in the character string.
Convert String type to Timestamp type
Set the date and time from the character string with POI
Uppercase only the specified range with substring. (How to use substring)
Change from SQLite3 to PostgreSQL
[Java beginner] Conversion from character string to numerical value-What is the parseInt method of the Integer class? ~
When the character string passed to C ++ by JNA is garbled
If you want to change the Java development environment from Eclipse
[Rails] How to omit the display of the character string of the link_to method
Change DB from SQLite to MySQL
The road from JavaScript to Java
How to change from HTML to Haml
How to compare only the time with Rails (from what time to what time, something like)
[Rails] How to create a table, add a column, and change the column type
[Java] Check if the character string is composed only of blanks (= Blank)
Change the half-width space of STS (Spring Tool Suite) from "u" to "・"
I want to get a list of only unique character strings by excluding fixed character strings from the file name
[Ruby] I want to make an array from a character string with the split method. And vice versa.
Deletes after the specified character from the character string
Set the date and time from the character string with POI
Change only one character from the String type string to uppercase
About the default behavior of decimal point rounding using java.text.NumberFormat
I want to find out what character the character string appears from the left
Investigate the replacement from Docker to Podman.
[Ruby] From the basics to the inject method
[Java] Convert Object type null to String type
How to change the timezone on Ubuntu
Ransack sort_link How to change the color!
Job change from SIer to Web engineer
[Java] Comparison of String type character strings
[Java] How to convert one element of a String type array to an Int type
[Java] How to easily get the longest character string of ArrayList using stream
I tried to get the distance from the address string to the nearest station with ruby
How to get the date from the JavaScript Date type that C # developers are addicted to
Conditional branching of the result of SQL statement to search only one in Java