From: Joaquim Rui de Castro Rodrigues (joaquim.rodrigues_at_ipleiria.pt)
Date: Thu Jun 04 2020 - 03:24:22 CDT

Hi,

Use string range: https://wiki.tcl-lang.org/page/string+range

HTH,
Rui Rodrigues

________________________________________
De: owner-vmd-l_at_ks.uiuc.edu <owner-vmd-l_at_ks.uiuc.edu> em nome de Prathit Chatterjee <pc20apr_at_REMOVE_yahoo.co.in>
Enviado: 4 de junho de 2020 07:37
Para: vmd-l_at_ks.uiuc.edu
Assunto: vmd-l: Selecting first three characters of a variable with tcl in VMD

Dear VMD experts,

This is regarding selecting selected characters of a variable with tcl scripting in VMD.
I want to select first few characters of a variable, for example, first three characters (app) of the variable "apple":
======
vmd > set a apple
apple
vmd > string length $a
5
======

I am trying to play around with the command string but could not figure out so far.

Any relevant comments/suggestions will be greatly appreciated.
Thank you in advance,
Regards,
Prathit