//String with spaces I will trim String spaceString = ” wassup? “; //Using the Trim Function String slimString = spaceString.trim(); ———–Program Example——— //Programmer:Akinwale Owi //Company:Dagba Computers //Program…… Read more “Java #25: How to use the Trim Function in Java”
Category: Java Programs
Java #24: How to Grab a specific Char Value out of a String
//Programmer:Akinwale Owi //Company:Dagba Computers //Program Purpose:How to get a specific char value of out of a string package dagba.samples; /** * * @author Akin */ public class…… Read more “Java #24: How to Grab a specific Char Value out of a String”
Java #23: How to find the length of a String in Java
Length function = .length(); ———-Full Source Code———– //Programmer:Akinwale Owi //Company:Dagba Computers //Program Purpose:How to find the String Length package dagba.samples; /** * * @author Akin */ public…… Read more “Java #23: How to find the length of a String in Java”
Java #22: How to Compare Strings in Java (Case Wise Too)
————————————Full Source Code———————- /Programmer:Akinwale Owi //Company:Dagba Computers //Program Purpose:Comparing Strings(Case wise too) package dagba.samples; /** * * @author Akin */ public class DagbaSamples { /** * @param…… Read more “Java #22: How to Compare Strings in Java (Case Wise Too)”
Java #21: How to Join Strings with a Delimiter in Java
//String I’m going to add to add together with a / in between all strings String pets = String.join(“/”,”dogs”, “cats”, “hamsters”); ———————Full Source Code—————– //Programmer:Akinwale Owi //Company:Dagba…… Read more “Java #21: How to Join Strings with a Delimiter in Java”
Java #20: How to use SubString in Java
//String I’m going to grab a substring from String wholeString = “Dagba Computers”; //printing out whole string to test System.out.println(wholeString); //Getting the substring of wholeString String subbedString…… Read more “Java #20: How to use SubString in Java”
Java #19: How to Increment/Decrement a Number in Java
//How to increment number //pre-Increment variable int preIncrement = 4; //printing out pre-increment number to check System.out.println(preIncrement); //incrementing number preIncrement++; ——————————————————————————— //How to Decrement by One //Decrement…… Read more “Java #19: How to Increment/Decrement a Number in Java”
Java #18:How to Round a Number in Java
//Number that is going to be Rounded double preRound = 55.655688; //Rounding the Number double postRound = Math.round(preRound); ———————-Full Program——————– //Programmer:Akinwale Owi //Company:Dagba Computers //Program Purpose:How to…… Read more “Java #18:How to Round a Number in Java”
Java #17: How to Raise a Number to a Power in Java
//Variable that Holds the Pre-Raised Number double preRaised = 4; //Raising the preRaised variable to the third power double postRaised = Math.pow(preRaised,3); ———————–Full Program————————- //Programmer:Akinwale Owi //Company:Dagba…… Read more “Java #17: How to Raise a Number to a Power in Java”