Guest User

Untitled

a guest
Oct 5th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. char[] BackSlashesToSlashes(char[] s) {
  2. char[] ret;
  3. foreach (c; s) {
  4. if (c == '\\') {
  5. ret ~= '/';
  6. } else {
  7. ret ~= c;
  8. }
  9. }
  10. return ret;
  11. //
  12. // this, and string.replace cause segfaults...
  13. //
  14. //return cast(char[])(s.map!( c => c == '\\' ? '/' : c ).array());
  15. }
Advertisement
Add Comment
Please, Sign In to add comment