Home » Archives for Nikos Maravitsas » Page 4

Author Archives: Nikos Maravitsas

Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. During his studies he discovered his interests about software development and he has successfully completed numerous assignments in a variety of fields. Currently, his main interests are system’s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human – machine interaction and mobile development.

Java String split Example

In this Java String split example we are going to see how to split a String in Java into smaller sub strings. It is extremely common to want to split a String into parts. These parts are separated by a specific delimiter. And in order to avoid parsing the String yourself, Java offers split API method. 1. Using split It ...

Read More »

Java String pool Example

In this example we are going to talk about a very interesting subject, Java String pool. As the name suggest, String pool is a pool, or else a set, of String objects located in a special place in Java Heap. Java creators introduced this String pool construct as an optimization on the way String objects are allocated and stored. String ...

Read More »

Java String Replace and ReplaceAll String Methods

In this example, we are going to see how to use the String Replace and ReplaceAll String class API Methods in Java. With replaceAll, you can replace all character sequences and single characters from a String instance. As you know, String objects are immutable. This means, that every time you try to change its value, a new String object is ...

Read More »

Java String matches Example

In this example we are going to talk about matches String Class method. You can use this method to test a String against a regular expression. Testing a String against a regular expression is a very common operation for interactive applications, as it is heavily used to perform validity checks on user input. It can also be used for several ...

Read More »

String length Java Example

In this example, we are going to see how you can find out the length of a String in Java. By length string, we mean the number of Unicode characters or Code Units. 1. What is String in Computer Programming In computer programming, a string is traditionally sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to ...

Read More »

String.format Java Example

In this post, we feature a comprehensive String.format Java Example. In Java, printf is exactly like string.format, but it does not return anything, it only prints the result. We are going to see how to format Strings in Java. Developers familiar with C, will find the methods used here resembling printf function. And the formatting specifications are very similar. In ...

Read More »

Java String Contains Example

In this example we are going to see how you can check if a String contains another String in Java. The Java String Class API offers a method to do that, contains. To be more specific the complete signature of contains method is public boolean contains(CharSequence s). Which means that you are trying to see, whether a CharSequence s resides ...

Read More »

Java Concatenate Strings Example

In this example, we are going to explain string concatenation in Java. We are going to show how you can concatenate in Java two Strings, or in fact, any Object with a String in Java. As we’ve mentioned in an introductory article about Java String Class, String is one of the most used types in Java programs. So Java creators ...

Read More »

String CompareTo Java Example

In this post, we feature a comprehensive String CompareTo Java Example. In a previous post, Java Compare Strings Example, we showed how to compare two Strings in java. In that example the test was simple: check if two String objects are equal. But consider the case when you have a collection of Strings and you want to sort it. Of ...

Read More »

Java Compare Strings Example

Today we are going to focus on how you can compare Strings in Java. By comparing, in this case, we mean to check if their values are equal. In the previous example, we talked generally about the Java String Class. We stated that Java lets you initialize a String like a primitive, and use the ‘+’ operator like you would ...

Read More »