Java properties nonstandard example - how to parse the file correctly?
Problem:
user is trying to process Java properties file which contains following strings:
enduser:passwordExpire.today = Your password will expire today
enduser:passwordExpire.tomorrow = Your password will expire tomorrow
He wishes to extract the text after equal sign only while he is getting everything after colon.
Solution:
the reason for getting the context after colon extracted is that Wordbee Java properties parser interprets colon as the end of the key.
If we replace colon by any other unique sign then equal sign will be the delimiter.
In this case we can for example use ##---## to make our strings look like this:
enduser##---##passwordExpire.today = Your password will expire today
enduser##---##passwordExpire.tomorrow = Your password will expire tomorrow
Of course after the translation and production of the final file we need to open the file and replace ##---## back with colon to format it as an original file.
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare