iTextSharp.text.pdf.hyphenation.SimplePatternParser.NormalizeException C# (CSharp) Method

NormalizeException() protected method

protected NormalizeException ( ArrayList ex ) : ArrayList
ex ArrayList
return ArrayList
        protected ArrayList NormalizeException(ArrayList ex) {
            ArrayList res = new ArrayList();
            for (int i = 0; i < ex.Count; i++) {
                Object item = ex[i];
                if (item is String) {
                    String str = (String)item;
                    StringBuilder buf = new StringBuilder();
                    for (int j = 0; j < str.Length; j++) {
                        char c = str[j];
                        if (c != hyphenChar) {
                            buf.Append(c);
                        } else {
                            res.Add(buf.ToString());
                            buf.Length = 0;
                            char[] h = new char[1];
                            h[0] = hyphenChar;
                            // we use here hyphenChar which is not necessarily
                            // the one to be printed
                            res.Add(new Hyphen(new String(h), null, null));
                        }
                    }
                    if (buf.Length > 0) {
                        res.Add(buf.ToString());
                    }
                } else {
                    res.Add(item);
                }
            }
            return res;
        }