Monday, December 7, 2015

strings

Strings

  • A string is a sequence of letters, it always need not be enclosed in the quotes until you use some white spaces in between the words. Tcl is a string based language it provides rich set of operations on strings.
Examples :
set str1 one
set str2 "two three"

set str3 I\ need\ not\ enclose\ this\ in\ quotes

  • Following operations can be executed on strings:
    • string compare
    • string equal
    • string length
    • string match #global expression
    • string toupper
    • string tolower
    • string totitle #it will convert the starting letter of string to uppercase
    • string index
    • string range
    • string reverse
Example :




No comments: