Detect and shorten ALL urls in string

后端 未结 1 1759
失恋的感觉
失恋的感觉 2021-01-24 01:58

Suppose I have a String message:

\"you should upload file.zip to http://google.com/extremelylonglink.zip, not https://stackoverflow.com/extremelylonglink.zip. try again.

相关标签:
1条回答
  • 2021-01-24 02:32

    Use appendReplacement and appendTail. See example in the Java tutorial and another example closer to what you are trying to do.

    0 讨论(0)
提交回复
热议问题