c# - Get TextBlock lines as separate strings WPF -


is there way textblock lines separate strings after text wrapping? example, if have textblock defined this:

textblock mytextblock = new textblock(); mytextblock.textwrapping = textwrapping.wrap; mytextblock.text = verylongstring; 

is possible separate string each row displayed in textblock, created textwrapping.wrap?

textblock has property called inline, use , access strings 1 one,

            stringbuilder s = new stringbuilder();             foreach (var line in txtsample.inlines)             {                 if (line linebreak)                     s.appendline();                 else if (line run)                     s.append(((run)line).text);             }             var text = s.tostring();            } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -