How to extract "information" from "ccccccccaaabbbbaaaabbinformationabcaaaaaabbbbbbbccbb" in tcl using a single command?
Submitted by: Administrator% 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
%
Submitted by: Administrator
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
%
Submitted by: Administrator
or
string trim $a abc
Submitted by: Nivya
string trim $a abc
Submitted by: Nivya
Read Online TCL (Tool Command Language) Job Interview Questions And Answers
Top TCL (Tool Command Language) Questions
☺ | How to check whether a string is palindrome or not using TCL script? |
☺ | What is TCL? |
☺ | Where can we find the sample tcl programs? |
☺ | How do you find the length of a string without using string length command in TCL? |
☺ | How increment a character? For example, I give a and I should get b? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |