Faced the following misunderstanding, when porting code to c # under java. It is necessary to extract a substring from a string of characters, take, starting from a certain k-th position of n-characters. Actually, the code:
str = "((15+3)+14/2+(7*2)+3^2+(12+(7*2)))"; System.out.println(str.substring(27, 5)); For me, as a person who is somewhat familiar with Sharp, the code is quite understandable and logical. In line 33 characters, in fact, I need to get a substring with 27 - a character (32 characters each). But as a result, I get an OutOfBoundException error. And even if I want to take 3 characters from 10 position. What could be the problem?