string FormatString(string text)
{
// example of a string text recieved...
// /test/test1/test2/important-text-here-random
// example a-top => return should be...
// Important Text Here Random
// please and ty
// a quirk I have is that the text that needs to be formatted is always after that last/incase I do not know how to calculate a random amount of/in a string.
}
問題出在功能本身。格式化字符串,清除字符串中的特定字符?
請幫忙?我需要最有效的方式這樣做......收到將文本
例如:/測試/ TEST1/TEST2 /重要的文本,這裏隨機
我需要它格式化爲:重要的文本這裏隨機
謝謝。
我不能讓你的問題。你可以請嘗試重新措辭嗎? – Sachin 2015-03-02 06:07:22
我重新措辭它。 – Andrew 2015-03-02 06:08:59
如果這是一個文件路徑,請嘗試使用'var afterSlash = Path.GetFileName(text);'。 – 2015-03-02 06:11:49