Question
Complete the Java code to replace all occurrences of a specific word (case-insensitive) in a string. public class RegexReplacer { public String replaceWord(String text, String wordToReplace, String replacement) { // Example: text="Hello World", wordToReplace="world", replacement="Java" // Expected: "Hello Java" String regex = "(?i)\\b" + Pattern.quote(wordToReplace) + "\\b"; _________ // Line to complete } }
More IT Operating System Questions
- Cocomo (Constructive Cost Model) is a regression model based on LOC where LOC is :
- What is the primary purpose of the Banker's Algorithm in operating systems?
- What is the best case time complexity of merge sort?
- MIS is a type of:
- Which data structure is used to implement Undo/Redo functionality in text editors like MS Word or VS Code?
- Given: R(A,B,C,D) with FDs: A→B, B→C, C→D. Which of the following is true?
- Consider a min-heap represented as an array: [1, 3, 5, 7, 9]. If the element 2 is inserted into this min-heap, what will be the state of the heap array aft...
- Which algorithm is commonly used for Part-of-Speech tagging?
- Complete the recursive search function for a Binary Search Tree (BST). class Node: def __init__(self, data): self.data = data self....
- Which of the following best describes network topology?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)