How-to articles, tricks, and solutions about STRING

How to convert Java String into byte[]?

To convert a Java string into a byte array, you can use the getBytes() method of the java.lang.String class. This method returns an array of bytes representing the string in a specific encoding.

how to convert java string to Date object

To convert a string to a Date object in Java, you can use the parse() method of the SimpleDateFormat class.

How to convert list to string

You can use the join() method to convert a list of strings to a single string.

How to convert object array to string array in Java

To convert an object array to a string array in Java, you can use the toString() method of the Object class and the map() method of the Stream class.

How to convert String object to Boolean Object?

To convert a String object to a Boolean object in Java, you can use the Boolean.valueOf method:

How to convert string representation of list to a list

You can use the ast.literal_eval() function from the ast module to safely evaluate a string and convert it to a list.

How to convert String to long in Java?

To convert a string to a long in Java, you can use the parseLong() method of the java.lang.Long class. This method parses the string as a signed decimal long, and returns the resulting long value.

How to Convert String to Number in JavaScript

There are several methods of converting a string into a number: parseInt() #; parseFloat() #, Number() #, etc. See examples.

How to Convert String to Title Case with JavaScript

Read this JavaScript tutorial and learn information about the combinations of methods that make it possible to convert the string to title case easily.

How to convert Strings to and from UTF8 byte arrays in Java

To convert a String to a UTF-8 encoded byte array in Java, you can use the getBytes method of the String class and specify the character encoding as "UTF-8".

How to convert/parse from String to char in java?

In Java, you can convert a string to a character using the charAt() method of the String class. This method takes an index as an argument and returns the character at that index.

How to Copy Array Items into Another Array

Read this JavaScript tutorial and learn several useful methods of copying array items into another array. Get to know which method to choose for your case.

How to Count String Occurrence in String

Read this tutorial and learn several useful methods that are used to count the string occurrence in a string. Choose one of the working methods for you.

How to Create and Parse JSON Data with PHP

JSON is a data-interchange format, which can be generated and parsed by PHP or other programming languages. See how to create and parse JSON data by PHP.

How to Create URL Slug from String in PHP

Here is a short tutorial that will represent to you the way of creating a URL slug from string with PHP. It should be an essential part of any website.

How to delete a character from a string using Python

You can use string slicing to remove a specific character from a string in Python.

How to Delete the First Character of a String in JavaScript

Read this tutorial and learn some useful information about the methods that are used for deleting the first character of a string in JavaScript easily.

How to Do String Interpolation in JavaScript

Read this tutorial and learn the simplest method of doing a string interpolation in JavaScript. Also, read information about string literal and placeholder.

How to Encode and Decode Strings with Base64 in JavaScript

Read this tutorial and learn useful information about two JavaScript built-in functions which are used to convert a string to and from base64 encoding.

How to Encode JavaScript URL

In the tutorial, you can read and learn useful information about the two JavaScript functions that are used for encoding URL and their use cases in detail.

How to Encrypt and Decrypt a String in PHP

On this page, you can find comprehensive information about encrypting and decrypting a string in PHP. Learn how to do it with the functions of openssl.

How to enter quotes in a Java string?

To enter quotes in a Java string, you can use the escape character \ to indicate that the quote is part of the string, rather than the end of the string.

How to evaluate a math expression given in string form?

There are a few different ways to evaluate a math expression given in string form:

How to Execute a JavaScript Function when You have Its Name as a String

Read this tutorial and learn about the safe method of calling a function when you have its name as a string. Also, read about why you should not use eval().

How to extract a substring using regex

To extract a substring from a string using a regular expression in Java, you can use the following steps: