replace line breaks with html line breaks :
declare BBjString test!
test!="HELLO\r\nWORLD\n\rAGAIN"
foo$=test!.replaceAll("\\r\\n|\\n|\\r|"+$0d0a$+"|"+$0d$+"|"+$0a$","<br>")
?foo$
test$="HELLO\r\nWORLD\n\rAGAIN"
test$=cast(BBjString,test$).replaceAll("\\r\\n|\\n|\\r|"+$0d0a$+"|"+$0d$+"|"+$0a$","<br>")
?test$
replace multiple chars by char :
src! = "ABC___(hellop)_myQuotesAreHere"+$2222$+"12345_ /&%"
ListOfDislikedChars$ ="[\/^\*\$\(\)\&\=\?\'\*\+\-\.\:\,\;\""\%]"; REM [^/....]*/$
firstMatchAtPos=mask(src!,ListOfDislikedChars$) ; ?"pattern matched first at position "+str(firstMatchAtPos)
?src!
des! = src!.replaceAll(ListOfDislikedChars$,java.util.regex.Matcher.quoteReplacement("X"))
?des!
remove path from filename : x! = programName!.replaceAll(".*(\\|/)","")
remove extension from filename : x! = programName!.replaceAll("\.\w+$","")
keep path only from filename : x! = programName!.replaceAll("(\\|/).*","")
Keine Kommentare:
Kommentar veröffentlichen