Skip to content
Advertisement

Tag: string

Add strings to an array of strings inside for loop using java

I have a for loop and I want to add strings to a string array inside that loop. How can I achieve that? The output should look like this- Answer You can create the result array with a size that matches the registration array length, since you know you want to create one result for each registration entry. You then

How can I convert arraylist to arraylist

My goal is to find on which specific index is String from ArrayList and add them to new ArrayList, So if house is [0] than i want to return new ArrayList with integer. At the begging I have ArrayList like this Input : And I want to get new ArrayList like this Output: Answer You can do it just by

Rearrange substrings using two criteria [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question Given a String: I need to sort its substrings first by numbers (in descending order) and then by letters, so

Removing the integers in the output when inputted with a String [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 months ago. Improve this question I am struggling on my code. My prof told us to make a line of code in Eclipse which, when

Replacing a portion of string entry

I have a list of Strings, and would want to replace a few characters of the individual string entry by new string and add to the list. For eg: I believe it can be achieved with regex, and I need some inputs here. Suggestions? Answer Use this code for your problem

Advertisement