TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

<< Back to JAVA

Java String Class

Review the String class. Declare, concatenate and manipulate strings.
String. Deep in the cave you encounter a pool. You discover a message written upon the water's surface. It is a string with letters and words.
Truncate. This method uses substring() internally. We can get strings relative to other strings—between, before and after other strings.Substring: TruncateSubstring: Between, Before and After
Arrays. The internal data, the characters, of a String can be thought of as an array. And with built-in methods, we can convert Strings into, and from, different types of arrays.Byte Array, StringChar Array, String
Whitespace. Strings often contain whitespace characters, and the trim() method does not handle all problems with whitespace. We convert UNIX and Windows newlines.Whitespace: methodsWhitespace: newlines, lineSeparator
Uppercase first letter. With toUpperCase we change all letters in a String. But often we want to modify just the first letter, or the first letter of individual words.Uppercase First Letter
StringTokenizer. Java is full of old things we should not use. StringTokenizer is one example. Its functionality is easily replaced with split() but it exists for backwards compatibility.StringTokenizer
Reverse. Strings cannot be easily manipulated in their initial form. Instead we transform them to a char array. In this way we can even reverse them.Reverse String
A final note. A String can represent any data. But textual representation is rarely the most efficient form. Directly storing numbers as ints is faster.
© TheDeveloperBlog.com
Home
The Dev Codes

Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf