14-02
This commit is contained in:
9
test/parser/back.dart
Normal file
9
test/parser/back.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
void main(){
|
||||
print(backPath('/a/c/d?k=v'));
|
||||
}
|
||||
|
||||
String backPath(String path){
|
||||
Uri uri = Uri.parse(path);
|
||||
List<String> parts = List.of(uri.pathSegments)..removeLast();
|
||||
return '/${parts.join('/')}';
|
||||
}
|
||||
Reference in New Issue
Block a user