I am trying to print a string by thermal printer,but the problem is that paper accept only 32 charcters in a line and than break rest text to another line,by this last character always cut into two parts and string is hard to understand. I also use a linq mehtod to break line after 32th character but the last character is cutting. I just want after last Comma "," in first 32 characters a new line will be add by that my string will break in readable text. I am sharing my code.Thanks in advance for help..
var PrintStr = "01-(200),02-(200),03-(200),04-(200),05-(200),06-(200),07-(200),08-(200),09-(200),10-(200),11-(200),12-(200),13-(200),14-(200),15-
(200),16-(200),17-(200),18-(200),19-(200),20-(200),21-(200),22-(200),23-(200),24-(200),25-(200),26-(200),27-(200),28-(200),29-(200),30-(200),31-(
200),32-(200),33-(200),34-(200),35-(200),36-(200),37-(200),38-(200),39-(200),40-(200),41-(200),42-(200),43-(200),44-(200),45-(200),46-(200),47-(200),48-
(200),49-(200),50-(200),51-(200),52-(200),53-(200),54-(200),55-(200),56-(200),57-(200),58-(200),59-(200),60-(200),61-(200),62-(200),63-(200),64-
(200),65-(200),66-(200),67-(200),A1111-(200)"
var AdjustPrintStr = string.Join(Environment.NewLine, PrintStr.ToLookup(c => k++ / 32) .Select(e => new String(e.ToArray())));
output--
01-(200),02-(200
),03-(200),04-(200),05-(200),06-
(200),07-(200),08-(200),09-(200)
,10-(200),11-(200),12-(200),13-(
200),14-(200),15-(200),16-(200),
17-(200),18-(200),19-(200),20-(2
00),21-(200),22-(200),23-(200),2
4-(200),25-(200),26-(200),27-(20
0),28-(200),29-(200),30-(200),31
-(200),32-(200),33-(200),34-(200
),35-(200),36-(200),37-(200),38-
(200),39-(200),40-(200),41-(200)
,42-(200),43-(200),44-(200),45-(
200),46-(200),47-(200),48-(200),
49-(200),50-(200),51-(200),52-(2
00),53-(200),54-(200),55-(200),5
6-(200),57-(200),58-(200),59-(20
0),60-(200),61-(200),62-(200),63
-(200),64-(200),65-(200),66-(200