|EOL: String related exceptions [message #1736838]
||Sat, 02 July 2016 15:40
| Alireza Rouhi
Registered: December 2015
I have a string comment s with the following value:
* comment line 1
* comment line 2
* comment line 3
I want to remove the '/*' and '*' from this string. When I use the following statement to remove '*' from the s string:
I get the following exception error:
Internal error: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
Finally, I would like to display the string on the console view without any '/*' and '*'. Of course, it seems that copying the string (character by character, except '/*' and '*') can be a solution here. However, I cannot implement this approach as well! Since the string copy loop as following,
var t: String;
var i: Integer = 0;
while (i < s.length())
if (s.charAt(i) <> "*" and s.charAt(i) <> "/") // it's always 'true'
t = t + s.charAt(i);
i = i + 1;
is not working as I expect!
Is there any trick to solve this problem?
[Updated on: Mon, 04 July 2016 07:28]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01755 seconds