logo
  • 教程列表
  • SO官方文档
  • 解码网址
    • 简单的例子
    • 使用 printf 解码字符串
  1. StackOverflow 文档
  2. Bash 教程
  3. 解码网址
  4. 使用 printf 解码字符串

使用 printf 解码字符串

Created: November-22, 2018

#!bin/bash
    
$ string='Question%20-%20%22how%20do%20I%20decode%20a%20percent%20encoded%20string%3F%22%0AAnswer%20%20%20-%20Use%20printf%20%3A)'
$ printf '%b\n' "${string//%/\\x}"

# the result
Question - "how do I decode a percent encoded string?"
Answer   - Use printf :)
  • 简单的例子

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明