I have to convert all this C# string manipulation to Rust. Send help.