ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs LoadFile.java
Date Fri, 01 Feb 2002 23:02:34 GMT
From: <stevel@apache.org>

>   +    protected String stripLineBreaks(String source) {
>   +        //Linebreaks. What do to on funny IBM mainframes with odd line
endings?
>   +        String linebreaks="\r\n";

Why are you not using System.getProperty("line.separator")
instead?  Or do you want \r stripped no matter
what platform the file is under?

>   +        int len=source.length();
>   +
>   +        StringBuffer dest=new StringBuffer(len);
>   +        for(int i=0;i<len;++i) {
>   +            char ch=source.charAt(i);
>   +            if(linebreaks.indexOf(ch)==-1) {
>   +                dest.append(ch);
>   +            }
>   +        }
>   +        return new String(dest);
>   +
>        }

Cheers,
Magesh




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message