java interview question - replace space with %20 in java - 1(2) [cracking the coding interview ]

preview_player
Показать описание
as far as the performance is concerned, the replace() method is a bit faster than replaceAll() because the later first compiles the regex pattern and then matches before finally replacing whereas the replace simply matches for the provided argument and replaces.

Please watch this video on 720p or 1080p for better visibility

Рекомендации по теме
Комментарии
Автор

The interviewer will surely ask you to write your own logic for solving the program rather than just using the inbuilt functionality of the language.

siddharthbhagwat
visit shbcf.ru