字符串"jdbc:postgresql://localhost:5432/DatabaseName"
我的要求是只从上面的字符串获取DatabaseName。
我试过在下面的链接,但它没有工作。
${Explode} $0 "jdbc:postgresql://localhost:5432/" "$v1" 它给出错误无效的命令。
http://nsis.sourceforge.net/Explode
在NSIS语言中是如何可能的。因为我对NSIS语言不太熟悉。请提供必要的帮助。提前谢谢。
发布于 2014-11-27 18:34:54
如果您只需要在上一次/之后获得其余的字符串,那么只需使用一些基本的NSIS字符串处理:
Section
StrCpy $0 "jdbc:postgresql://localhost:5432/DatabaseName"
StrCpy $1 0
loop:
IntOp $1 $1 - 1 ; Character offset, from end of string
StrCpy $2 $0 1 $1 ; Read 1 character into $2, -$1 offset from end
StrCmp $2 '/' found
StrCmp $2 '' stop loop ; No more characters or try again
found:
IntOp $1 $1 + 1 ; Don't include / in extracted string
stop:
StrCpy $2 $0 "" $1 ; We know the length, extract final string part
DetailPrint "|$2|"
SectionEndhttps://stackoverflow.com/questions/27164243
复制相似问题