0
0

More than 5 years have passed since last update.

substr関数

Posted at

0文字目から1文字切り出す

# echo "123456" | awk '{print substr($0,0,1)}'
1

3文字目から2文字切り出す

# echo "123456" | awk '{print substr($0,3,2)}'
34

2文字目から文字列の最後まで切り出す

# echo "123456" | awk '{print substr($0,2,length($0))}'
23456

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0