Java String.replaceAll() The method replaceAll() replaces all occurrences of a String in another String. Available Signatures [source,java,gutter:,false] public String replaceAll(String regex, String replacement) Example [source,java,gutter:,true] @Test public void whenCallReplace_thenCorrect() { String s = “I learn Spanish”; assertEquals(“I learn French”, s.replaceAll(“Spanish”, “French”)); }

Java String.substring() The method substring() comes with two signatures. If we pass the beginIndex and the endIndex to the method, then it obtains a part of a String given the starting index and the length of the result. We can also pass the beginIndex only and obtain the part of… Continue Reading substring

Java String.startsWith() The method startsWith() is a convenience method that checks whether a String starts with another String. We can also pass the index of the first character to start checking from. Available Signatures [source,java,gutter:,false] public boolean startsWith(String prefix) public boolean startsWith(String prefix, int toffset) Example [source,java,gutter:,true] @Test public void… Continue Reading starts-with

A Guide to Yum and Apt 1. Overview Package Managers are a great feature of every Linux system. They allow us to easily handle the installation, removal, and inspection of software packages. In this tutorial, we’ll learn how to use two among the most famous ones: YUM and APT. 2.… Continue Reading yum-and-apt