Methods 您可以组合方法并捕获输出吗?
我有一个方法如下所示:Methods 您可以组合方法并捕获输出吗?,methods,tcl,Methods,Tcl,我有一个方法如下所示: proc getJobinfo {question} { puts -nonewline "$question: " flush stdout gets stdin answer # Can you combine totitle and trim into one line? set titledanswer [string totitle $answer] return $titledanswer } 我想在一行中调用
proc getJobinfo {question} {
puts -nonewline "$question: "
flush stdout
gets stdin answer
# Can you combine totitle and trim into one line?
set titledanswer [string totitle $answer]
return $titledanswer
}
我想在一行中调用trim
和totitle
,可以吗
例如,在Python中:
company_name : str = userInput.trim().title()
是的,您可以:set titledanswer[string trim[string totitle$answer]
是的,您可以:set titledanswer[string trim[string totitle$answer]]