{"id":1931,"date":"2022-09-12T20:11:23","date_gmt":"2022-09-12T20:11:23","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=1931"},"modified":"2022-09-12T20:11:25","modified_gmt":"2022-09-12T20:11:25","slug":"java-string-strip","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/java-string-strip\/","title":{"rendered":"Java String Strip Method"},"content":{"rendered":"<p style=\"text-align: center;\"><strong>Java String Strip<\/strong><\/p>\n\n\n<p>Well, with this method, we can cut the whitespaces from the start and the end of the string. Have a look at the program below to understand the thing. This works similarly to the trim method.<\/p>\n\n\n\n<p class=\"has-background-color has-foreground-background-color has-text-color has-background\">public class StringMethods {<br>public static void main(String[] args) {<br>String spaces = &#8221; Java &#8220;;<br>System.out.println(spaces);<br>System.out.println(spaces.strip());<br>}<br>}<\/p>\n\n\n\n<p>So, executing the above program clearly gives us the string without the whitespaces in this case. Now let&#8217;s implement the other methods related to strip, which are stripLeading, and stripTrailing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java String Strip Well, with this method, we can cut the whitespaces from the start and the end of the string. Have a look at the program below to understand the thing. This works similarly to the trim method. public class StringMethods {public static void main(String[] args) {String spaces = &#8221; Java &#8220;;System.out.println(spaces);System.out.println(spaces.strip());}} So, executing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[12,11],"class_list":{"0":"post-1931","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-java-tutorial","7":"tag-java","8":"tag-java-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=1931"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1931\/revisions"}],"predecessor-version":[{"id":3014,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1931\/revisions\/3014"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=1931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=1931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=1931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}