Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading files. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 56 additions & 5 deletions src/main/java/com/github/curriculeon/StringParser.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,76 @@
package com.github.curriculeon;

import java.util.ArrayList;
import java.util.List;

import static java.lang.Integer.parseInt;

/**
* @author leon on 10/01/2019.
* Antonio Perdigoto on 10/01/2019.
*/

public class StringParser {

public static Character[] parseCharacters(String input) {
return null;
Character[] characters;

// Creating an array of string length
characters = new Character[input.length()];

// Iterate through string
for (int x = 0; x < input.length(); x++) {
// Add each character into array
characters[x] = input.charAt(x);
}
return characters;
}

public static Integer[] parseIntegers(String input) {
return null;
// Create new empty String array
input = input.trim();
Integer[] numbers;
numbers = new Integer[input.length()];

// Iterate through the string
for (int x = 0; x < input.length(); x++) {
// Add each element into the array
String temp = input.substring(x, (x+1));
numbers[x] = parseInt(temp);
}
//Return the array
return numbers;
}

public static List<String> toList(String[] input) {
return null;
// Create an empty List
List<String> list = new ArrayList<String>();

// Iterate through the string
for (int x= 0; x < input.length; x++) {
// Add each element into the list
list.add(input[x]);
}

// Return the List
return list;

}

public static String[] parseStrings(String input) {
return null;
// Create new empty String array
String[] strings;
strings = new String[input.length()];

// Iterate through the string
for (int x = 0; x < input.length(); x++)
// Add each element into the array
strings[x] = input.substring(x, (x+1));

//Return the array
return strings;
}

}