Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ruby的C#等价物';s字符串后继方法(“abcd”.succ->;“abce”)_C# - Fatal编程技术网

ruby的C#等价物';s字符串后继方法(“abcd”.succ->;“abce”)

ruby的C#等价物';s字符串后继方法(“abcd”.succ->;“abce”),c#,C#,C#是否有一个等价物?不,没有内置的等价物,当然你可以自己创建。我建议这样的框架: char[] array = text.ToArray(); // Perform mutation... // - find last alphanumeric character, and work backwards from that... // - or go from final character if there aren't any alphanumerics return new string

C#是否有一个等价物?

不,没有内置的等价物,当然你可以自己创建。我建议这样的框架:

char[] array = text.ToArray();
// Perform mutation...
// - find last alphanumeric character, and work backwards from that...
// - or go from final character if there aren't any alphanumerics
return new string(array);

就我个人而言,我想我个人需要更严格的语义,使用一组特定的字符。Ruby文档中给出的描述似乎是“我们会处理任何事情”,而不是在你试图做一些没有意义的事情时失败。当我期望A-Z,0-9时,我当然不想增加一些任意的UTF-16代码单元。

我读了文档,有一种奇怪的感觉,觉得有人没有更好的事情可做。Ruby会成为下一个PHP吗?