Skip to main content

All Questions

Tagged with
1 vote
2 answers
83 views

Finding the count of index in array of

How to find whether an array of string has only one index? I am trying with below piece of code but it is throwing index out of bound exception while the string contain only one letter. class Test { ...
Priyanka's user avatar
-3 votes
1 answer
69 views

problems with null and empty string array

class ToDoList { public static void toDO() { List<string[]> addEntry = []; bool toDoLoop = true; while (toDoLoop) { Clear(); WriteLine(&...
user avatar
-4 votes
1 answer
54 views

Longest Name in the list and Average birth date of all

My aim is to calculate the birth date of each person in the list we input as shown below and also output the longest name between them. Desired output: sauli,1948 tarja,1943 martti,1936 mauno,1923 ...
Amin Mousavi's user avatar
0 votes
0 answers
38 views

Store a Character Inside an Array

I am trying to store a character inside an array, let's say the user inputs a set of numbers "100011000110" and for each 1 the output should be 'X' and for each 0 the output should be 'O'. I ...
Roxmate's user avatar
0 votes
0 answers
105 views

list of int Log as String in java [duplicate]

I have a recipe, a list of Strings and int, which they are been recognized from an image. String elementText = ""; for (Text.Element element : line.getElements()) { ...
Giovanni's user avatar
  • 595
0 votes
1 answer
59 views

I'm trying to check my array list input if its an int or string but this seems to crash and just go into infinite loop

#include <iostream> #include <stdio.h> #include <ctype.h> using namespace std; class List{ private: int A[10]; int i; public: List(){ i = ...
Levi's user avatar
  • 19
0 votes
1 answer
48 views

Functions to combine elements of differents arrays?

I have a problem here, with the arrays. So. I have 3 arrays: const names = [Robert, Mark, Lindsay, Anna, Erin, Andrew] const surnames = [Smith, Black, White, Lewis, Cooper, Hill] const ages = [21, 14, ...
leopolis's user avatar
0 votes
2 answers
721 views

How to Remove Brackets from the Kotlin Array List

I have a method like this. I want to remove the brackets of the array list when I take the output. fun getAddOnNamesList(): ArrayList<String>? { if (!addOns.isNullOrEmpty()) { val ...
Himesh Perera's user avatar
0 votes
1 answer
76 views

How to convert this String array to array so that I can print all the results coming from a for loop to a string separated by commas

if(CoverageNames.size()>0) { StringBuffer tmp = new StringBuffer(); for(int i =0; i<CoverageNames.size();i++) { tmp.append(CoverageNames.get(i).getText())...
Majid's user avatar
  • 1
0 votes
1 answer
121 views

String Split and save into ArrayList in JAVA7 [closed]

I have a string wherein I need to split it and store in an ArrayList as seen below; All these using Java7. The below is the input for my program; String inputStr = "ABC:DONE:07JAN90:1234:00001111:...
Ashwin Kumar's user avatar
0 votes
1 answer
36 views

Error when trying to compare matching words from an arraylist when searching through words with more than 2 matching letters

ActionListener gives error when builtwordcheck length is longer than 2 letters. The point of the ActionListener when pressed is to print out all words in a list (word list array file) that match a ...
Teo's user avatar
  • 43
0 votes
3 answers
157 views

Method that corrects the text, inserting spaces after the comma in Java

I want to create a refactorSeparators method that takes an object of the String type as an argument. Method returns the text from the input object corrected so that if there is any a comma or a period ...
Sylwia's user avatar
  • 7
-1 votes
2 answers
904 views

How do I skip the first element from a String Array?

How do I skip the first element from a String Array?
user avatar
0 votes
6 answers
1k views

Finding the longest word ArrayList /Java

I want to write a method which finds the longest String (word). The output should be the longest word in case of two words with the same lenght the output should be: "More than one longest word&...
Sylwia's user avatar
  • 7
0 votes
2 answers
242 views

How to not split a word across line even if maximum limit reached for that line?

I am trying to align text to the left where each line has an input of a maximum number of characters, if the characters of the word exceed the total count, I want it to print on the same line and NOT ...
Zuha Khan's user avatar

15 30 50 per page
1
2 3 4 5
18