歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> Linux指令篇:字串處理--expr

Linux指令篇:字串處理--expr

日期:2017/2/27 9:48:42   编辑:更多Linux

  名稱:eXPr
  
  ### 字串長度
  
  shell>> expr length "this is a test"
  14
  
  ### 數字商數
  
  shell>> expr 14 % 9
  5
  
  ### 從位置處抓取字串
  
  shell>> expr substr "this is a test" 3 5
  is is
  
  ### 數字串 only the first character
  
  shell>> expr index "testforthegame" e
  2
  
  ### 字串真實重現
  
  shell>> expr quote thisisatestformela
  thisisatestformela




Copyright © Linux教程網 All Rights Reserved