on 04-09-2013 11:42 AM
Hi PI experts,
I'm not familiar with Java code but I should work on an existing UDF in a mapping. I would like to ask what does the code below do, as I can't understand this section:
String b= (a.substring(11,a.indexOf('.'))).replaceFirst("_", "");
where "a" is the file name and retrieved using the code for DynamicConfiguration
I tried to find some answers in the forum but didn't found the details I am looking for, specially this one used three functions/methods in a single line (substring + indexOf + replaceFirst).
Thanks!
Hi,
that means:
Take from the filename character number 11 up to first dot found. And replace from the result the first found underline with nothing.
abcdefghijklm_nop.qrm -> klmnop.
(very risky operation, if the file name is to short or does not contain a dot, you get stringIndexOutOfBoundException)
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.