replacing spaces with random letter

Help for those learning Tcl or writing their own scripts.
Post Reply
o
oxygen
Voice
Posts: 22
Joined: Mon Sep 05, 2005 2:22 pm
Location: Germany

replacing spaces with random letter

Post by oxygen »

Hello.

How can I replace spaces in a given fraze randomly with letters [a-z] and a specific color.


Thx in advance..
Oxygen
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

regsub -all {\s} $str \00304[randstring 1 abcdefghijklmnopqrstuvwxyz]\003 str
this will replace all spaces with a red-colored random alphabet.
o
oxygen
Voice
Posts: 22
Joined: Mon Sep 05, 2005 2:22 pm
Location: Germany

Post by oxygen »

working fine :)

Tnx Sir_Fz
Post Reply