Java Scanner Usage parseExperimentName(String name)

Here you can find the source of parseExperimentName(String name)

Description

Parses the experiment name.

License

LGPL

Parameter

Parameter Description
name the name

Return

the string

Declaration

public static String parseExperimentName(String name) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Scanner;

public class Main {
    /**/* ww  w.  jav  a  2s.co  m*/
     * Parses the experiment name.
     * 
     * @param name the name
     * @return the string
     */
    public static String parseExperimentName(String name) {
        Scanner scanner = new Scanner(name);
        StringBuilder csvName = new StringBuilder();
        scanner.useDelimiter("_");
        for (int i = 0; i < 4; i++) {
            if (scanner.hasNext()) {
                csvName.append(scanner.next() + ",");
            } else {
                csvName.append(",");
            }
        }
        scanner.close();
        return csvName.toString();
    }
}

Related

  1. numberOfLines(String text)
  2. OperasiMasukan()
  3. parameterInput(int start, int end)
  4. parse_str_vector(String str_vector)
  5. parseDailyData(final List lines, final List priceValues, final List dailyPriceDate)
  6. parseQueryString(String queryString)
  7. parseTime(String input)
  8. pathTokenList(String path)
  9. pressEnterToContinue()