如何在字符串中替换当前文件夹名称?
我有这条路:NSString *url=@"http://itunes.apple.com/us/app/APPNAME/idXXXXXXXXX";
NSString * title =[NSString stringWithFormat:@"Download ECG app %@ and get free reward points!",url];
NSArray* dataToShare = @[title];
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:^{}];
我的bat文件位于tld_Data\Managed\Assembly-CSharp-firstpass.dll
当我尝试从上面的路径创建文件夹时,我在路径中获取当前文件夹名称。
D:/Make/apply.bat
它会生成路径for /f "tokens=*" %%P in (tld_Data\Managed\Assembly-CSharp-firstpass.dll) do (
if not exist "folder%%~pP" md "folder%%~pP"
)
,但我需要D:/Make/Make/tld_Data/Managed/Assembly-CSharp-firstpass.dll
怎么做?
如果我将字符串更改为D:/Make/tld_Data/Managed/Assembly-CSharp-firstpass.dll
一切正常,但这并不好......
listA的:
C:/tld_Data\Managed\Assembly-CSharp-firstpass.dll
数组listB:
x:/tld_Data\Managed\Assembly-CSharp-firstpass.dll
x:/tld_Data\Managed\Assembly-CSharp.dll
x:/tld_Data\Managed\Assembly-UnityScript-firstpass.dll
x:/tld_Data\Managed\Assembly-UnityScript.dll
答案 0 :(得分:0)
我不确定真的能理解你的问题。
但试一试:
@echo off
for /f "tokens=*" %%P in (listb.bin) do (
echo if not exist "%%~dpnxP" md "%%~dpnxP"
)
如果输出正常,则删除回声