您当前的位置: 首页 > 

FPGA硅农

暂无认证

  • 0浏览

    0关注

    282博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Tcl学习笔记3

FPGA硅农 发布时间:2021-11-13 15:44:29 ,浏览量:0

string 命令合集

在这里插入图片描述 示例: compare

Vivado% string compare "abc" "abc"
0
Vivado% string compare "abc" "Abc"
1

equal

Vivado% string equal "abc" "abcd"
0

index

Vivado% set str "hello world"
hello world
Vivado% string index $str 4
o

range

Vivado% set str "hello world"
hello world
Vivado% string range $str 0 4
hello

replace

Vivado% set str "hello world"
hello world
Vivado% string replace $str 0 4 HELLO
HELLO world

length,repeat,reverse,toupper

Vivado% set str "hello world"
hello world
Vivado% string length $str
11
Vivado% string repeat $str 2
hello worldhello world
Vivado% string reverse $str
dlrow olleh
Vivado% string toupper $str
HELLO WORLD

first,last

Vivado% set str1 "hello"
hello
Vivado% set str2 "hello world,hello everyone"
hello world,hello everyone
Vivado% string first $str1 $str2
0
Vivado% string last $str1 $str2
12

trim

Vivado% string trim "  hello  " " "
hello
Vivado% string trimleft "  hello world" " "
hello world
Vivado% string trimright "hello world  " " "
hello world

etc

关注
打赏
1658642721
查看更多评论
立即登录/注册

微信扫码登录

0.0394s