C# Method like Base64String, but only alphanumeric (no plus or slash)

前端 未结 6 782
清歌不尽
清歌不尽 2021-02-13 11:25

is there any C# method that works similar to Convert.ToBase64String but doesn\'t generate anything except alphanumeric output?

Thanks!

6条回答
  •  醉酒成梦
    2021-02-13 12:03

    A common variant of base-64 (for use on query-string) is to use '-' and '_' in place of '+' and '/'. Perhaps a bit of Replace(...) at each end would do the job?

提交回复
热议问题