src/main/java/seedu/address/logic/parser/ParserUtil.java
public static Salary parseSalary(String salary) throws ParseException {
        requireNonNull(salary);
        String trimmedSalary = salary.trim();
        int index = trimmedSalary.indexOf("-");
        String startingSalary = trimmedSalary.substring(0, index).trim();
        String endSalary = trimmedSalary.substring(index + 1).trim();
        if (!Salary.isValidSalary(startingSalary, endSalary, trimmedSalary)) {
            throw new ParseException(Salary.MESSAGE_CONSTRAINTS);
        }
        return new Salary(startingSalary, endSalary);
    }
/**
     * Parses a {@code String salary} into a {@code Salary}.
     * Leading and trailing whitespaces will be trimmed.
     *
     * @throws ParseException if the given {@code Salary} is invalid.
     */
Parses a  String salary into a  Salary.
Leading and trailing whitespaces will be trimmed.

@throws ParseException if the given  Salary is invalid.
Parses a String salary into a Salary . Leading and trailing whitespaces will be trimmed . @throws ParseException if the given Salary is invalid .
public static Salary parseSalary(String salary) throws ParseException {
        requireNonNull(salary);
        String trimmedSalary = salary.trim();
        int index = trimmedSalary.indexOf("-");
        String startingSalary = trimmedSalary.substring(0, index).trim();
        String endSalary = trimmedSalary.substring(index + 1).trim();
        if (!Salary.isValidSalary(startingSalary, endSalary, trimmedSalary)) {
            throw new ParseException(Salary.MESSAGE_CONSTRAINTS);
        }
        return new Salary(startingSalary, endSalary);
    }
public static Salary parseSalary ( String salary ) throws ParseException { requireNonNull ( salary ) ; String trimmedSalary = salary . trim ( ) ; int index = trimmedSalary . indexOf ( "-" ) ; String startingSalary = trimmedSalary . substring ( 0 , index ) . trim ( ) ; String endSalary = trimmedSalary . substring ( index + 1 ) . trim ( ) ; if ( ! Salary . isValidSalary ( startingSalary , endSalary , trimmedSalary ) ) { throw new ParseException ( Salary . MESSAGE_CONSTRAINTS ) ; } return new Salary ( startingSalary , endSalary ) ; }
Parses a {@code String salary} into a {@code Salary}.
Parses a { @code String salary } into a { @code Salary } .