replaceAsExpected static method
Implementation
static String replaceAsExpected({required String path, String? replaceChar}) {
if (path.contains('\\')) {
if (Platform.isLinux || Platform.isMacOS) {
return path.replaceAll('\\', '/');
} else {
return path;
}
} else if (path.contains('/')) {
if (Platform.isWindows) {
return path.replaceAll('/', '\\\\');
} else {
return path;
}
} else {
return path;
}
}