Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.litesoft.aokeyhole.toolkit;

import org.litesoft.commonfoundation.base.*;
import org.litesoft.commonfoundation.typeutils.*;

public class SingleLineNotes {
    public static String[] convertStringToLines( String pNotesAsString ) {
        String[] rv = Strings.parseChar( normalize( pNotesAsString ), '|' );
        return (rv.length == 0) ? null : rv;
    }

    public static String convertLinesToString( String[] pNotes ) {
        if ( (pNotes == null) || (pNotes.length == 0) ) {
            return null;
        }
        StringBuilder sb = new StringBuilder( normalize( pNotes[0] ) );
        for ( int i = 1; i < pNotes.length; i++ ) {
            sb.append( '|' ).append( normalize( pNotes[i] ) );
        }
        return sb.toString();
    }

    private static String normalize( String pText ) {
        return Strings.normalizeNewLines( ConstrainTo.notNull( pText ) ).replace( '\n', '|' );
    }
}

Commits for litesoft/trunk/Java/KeyHole/src/org/litesoft/aokeyhole/toolkit/SingleLineNotes.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

803 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 04:08:34 +0000
802 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 04:04:47 +0000
787 GeorgeS picture GeorgeS Mon 30 Jul, 2012 03:00:12 +0000