Package org.boris.expr.function.excel

Source Code of org.boris.expr.function.excel.CLEAN

package org.boris.expr.function.excel;

import org.boris.expr.Expr;
import org.boris.expr.ExprException;
import org.boris.expr.ExprString;
import org.boris.expr.function.AbstractFunction;

public class CLEAN extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 1);
        String str = asString(args[0], true);
        StringBuilder sb = new StringBuilder();
        int len = str.length();
        for (int i = 0; i < len; i++) {
            char c = str.charAt(i);
            if (c != 7) {
                sb.append(c);
            }
        }
        return new ExprString(sb.toString());
    }
}
TOP

Related Classes of org.boris.expr.function.excel.CLEAN

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.