title: Is there any string manipulation commands/libraries I can use in bash/fishshell?
body: <p>I'm a newbie of bash/fish, and found some string operations are quite difficult, like:</p>
  
  <ol>
  <li>toUpperCase/toLowerCase</li>
  <li>a string is starts/ends with another string</li>
  <li>a string contains another string</li>
  <li>get the suffix of a file name</li>
  <li>trim a string</li>
  <li>check if matched a regular expression</li>
  </ol>
  
  <p>and so on. Although I can find all kinds of solutions for most of the cases, but I find it not easy to remember or use.</p>
  
  <p>So I just wonder if there is any command/library which supports most of the common string operations, suppose its name is <code>mystr</code>, so I can just use it like this:</p>
  
  <ol>
  <li><code>mystr --to-upper somestring</code></li>
  <li><code>mystr --starts-with sss somestring</code></li>
  <li><code>mystr --contains bbb sometring</code></li>
  <li><code>mystr --suffix somestring</code></li>
  <li><code>mystr --trim somestring</code></li>
  <li><code>mystr --match "some.*" somestring</code></li>
  <li><code>mystr --find-match "some(.*)" somestring $1</code>, I mean just get the matched part in <code>(.*)</code></li>
  </ol>