Skip to content

Commit

Permalink
Create StringTrimExample.java
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaykulkarni11 authored Oct 1, 2022
1 parent 80d7141 commit 007fef1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Java/StringTrimExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class StringTrimExample{
public static void main(String args[]){
String s1=" hello string ";
System.out.println(s1+"Chinmay");//without trim()
System.out.println(s1.trim()+"Chinmay");//with trim()
}}

0 comments on commit 007fef1

Please sign in to comment.