How to extract "information" from "ccccccccaaabbbbaaaabbinformationabcaaaaaabbbbbbbccbb" in tcl using a single command?

Answer Posted / pranab

% set
a "ccccccccaaabbbbaaaabbinformationabcaaaaaabbbbbbbccbb"
ccccccccaaabbbbaaaabbinformationabcaaaaaabbbbbbbccbb
% set b [string trimleft $a "abc"]
informationabcaaaaaabbbbbbbccbb
% set c [string trimright $b "abc"]
information


OR..
% set output [string trimright [string trimleft
$a "abc"] "abc"]
information
%

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi all, Is there any certification exams available for TCL and Perl. If so please let me know, my mailid is vpbharathi@gmail.com. Thanks in advance, Bharathi.P

2523