String s = "1,2,3,4,5,6,7,8,";
//goal: how to delete the last one ","
s = s.substring(0, s.length() - 1);
System.out.println(s);
Read More:
- How to convert a Java string into a number (stringtonumber)
- How to get the current time in java time string
- Java: How to Find the Minimum Value from a Random Array by Bubble Sort Method
- [Solved] Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- JAVA 8: How to Convert List to Map
- [Solved] Java Run Error: For input string: “XXX”
- JAVA: How to Read JSON Format Data (Web Game Development)
- Idea error: (44,22) Java: constant string too long
- [How to Fix]java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x98\x82\xF0\x9F…’
- How to Solve java server error (java application Run Normally)
- Problems and causes of Java’s main function format (public static void main (string args()))
- [Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““
- JAVA: How to Use Minio to upload pictures
- JAVA: How to Solve Foreach Loop Remove/add Element Error
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- [Solved] No validator could be found for constraint ‘javax.validation.constraints.NotBlank’ validating type ‘java.lang.String’
- JAVA: How to use the third-party font library method (using the third-party TTF / TTC font library method)
- How to Converte Java objects to jsonnode in Jackson (Four Methods)
- JAVA: How to Use Multipartfile to upload Files
- How to Close the Current Form in JAVA Swing