Blog

class Test { public static void main(String[] args) { String str = “ALEGRUTECHBLOG”; String strInLowerCase = str.toLowerCase(); System.out.println(strInLowerCase); } } Output: alegrutechblog   toUpperCase() Converts all of the characters in this String to the upper case using the rules of the default locale.   class Test { public static void main(String[] args) { String str…

Read More Working With Strings in Java – Part 2

In Swift, you can load HTML files into your WKWebView from a file that is part of your App Bundle. Before you use the below code snippet, please make sure that the HTML file you want to display in WKWebView is added to your project. Load Local HTML File to a WKWebView let myUrl = myProjectBundle.url(forResource: “my-html-file”,…

Read More WKWebView. Load HTML File from App Bundle.

class Test { public static void main(String[] args) { String str = “alegru”; char c = str.charAt(2); System.out.println(c); } } Output: e class Test { public static void main(String[] args) { String str = “alegru”; int index = str.indexOf(‘l’); System.out.println(index); } } Output: 1 class Test { public static void main(String[] args) { String str…

Read More Working With Strings in Java – Part 1

Java Strings are one of the most commonly used data types in Java programming, and understanding how to work with them effectively is essential for any Java developer. In this tutorial, I will cover everything you need to know about Java Strings, from the basics of creating and manipulating Strings to advanced concepts like regular…

Read More Mastering Java String: A Comprehensive Tutorial

import java.util.Arrays; class Test { public static void main(String[] args) { String[] names = {“John”, “Steve”, “Melissa”, “Maria”}; System.out.println(Arrays.toString(names)); } } Output: [John, Steve, Melissa, Maria]   copyOf(type [] a, int n) Returns a new copy of the array, which consists of the first n of its elements. import java.util.Arrays; class Test { public static…

Read More Arrays class in Java

class Test { int[] a; int b[]; int []c; } class Test { int[] a = new int[100]; int b[] = new int[]{1, 2, 3}; int[] c = {1, 2, 3}; } class Test { public static void main(String[] args) { // initialize the array int[] a = new int[3]; // add elements to array…

Read More Java Arrays

In this short Swift code example, you will learn how to check if file exists at specified path. Find a Documents directory on device Check if file exists at specified file path let fileNameToDelete = “myFileName.txt” var filePath = “” // Fine documents directory on device let dirs : [String] = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.allDomainsMask, true) if…

Read More Check if a File Exist

In this tutorial, you will learn how to programmatically create a UITextField in Swift. It will be a short tutorial with a very simple code example, but it will cover all the following: Create UITextField of specific height and width, Position UITextField at the center of the view, Set UITextField backgroundColor, Set UITextField textColor, Set…

Read More Create a UITextField in Swift Programmatically

Java is a popular object-oriented programming language used to build robust, scalable, and maintainable applications. One of the key features of Java is its support for method overloading and method overriding, which allows developers to write more efficient and flexible code. Method overloading and method overriding are two important concepts in Java that are often…

Read More Method Overloading vs Method Overriding in Java

In this tutorial, you will learn how to store Key-Value pairs in your apps local storage. For this purpose we will follow the next steps: Create new Flutter App, Get the dependency using pub get, Save data, Read data, Remove data. 1. Create a New Flutter Project Go ahead and create a new Flutter app.…

Read More Store Key-Value Data in Local Storage in Flutter