You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by erik_romson <er...@zenior.no> on 2017/01/25 10:15:51 UTC

bindy trim fixedlength

in the last commit 0e72f475f80a9699fe49004c431e1ce4e360c35d for
org.apache.camel.dataformat.bindy.BindyFixedLengthFactory

the trimming was changed 

from 

            if (dataField.trim()) {
                //token = token.trim();
            }

to

            if (dataField.trim()) {
                token = trim(token, dataField, paddingChar);
                //token = token.trim();
            }

the trimfunction only trims to the right OR left

    private String trim(String token, DataField dataField, char paddingChar)
{
        char myPaddingChar = dataField.paddingChar();
        if (dataField.paddingChar() == 0) {
            myPaddingChar = paddingChar;
        }
        if ("R".equals(dataField.align())) {
            return leftTrim(token, myPaddingChar);
        } else {
            return rightTrim(token, myPaddingChar);
        }
    }

I really just want to trim on both sides also the documentation on this is
not updated. 

thanks for all good work

/erik



--
View this message in context: http://camel.465427.n5.nabble.com/bindy-trim-fixedlength-tp5793047.html
Sent from the Camel - Users mailing list archive at Nabble.com.