V
Vinicius Cubas Brand
Hello. I am trying to find a method somewhere that makes replace in
substrings. For instance, I have seen that the String class have the
method replace(String regex, String replacement). I need a method that
do the replace only for a substring of this string, like something for
instance replace(String regex, String replacement, int startPosition,
int endPosition). So the replace would happen just inside the string
interval between startPosition and endPosition. Do you know if it is
some method implemented that does this operation? How would you do
this?
While writing this message I thought in solving this problem by
splitting the original string in three and just using the replace
operation in the middle string. However I need to do a lot of
replacements in a lot of sub-parts of the string, I think this will be
heavy to proccess.
substrings. For instance, I have seen that the String class have the
method replace(String regex, String replacement). I need a method that
do the replace only for a substring of this string, like something for
instance replace(String regex, String replacement, int startPosition,
int endPosition). So the replace would happen just inside the string
interval between startPosition and endPosition. Do you know if it is
some method implemented that does this operation? How would you do
this?
While writing this message I thought in solving this problem by
splitting the original string in three and just using the replace
operation in the middle string. However I need to do a lot of
replacements in a lot of sub-parts of the string, I think this will be
heavy to proccess.