Def countUppercase(s):
count=0
for i in s:
if i.isupper():
count+=1
s=s.replace(i, "")
else:
s=s.replace(i, "")
countUppercase(s)
return count
element=input("Enter the string: ")
string=countUppercase(element)
print("\nNumber of upper letter in the string: ",string)
The answer to this question would be, A. True
Google is an example of B, A search engine
Answer:
public class Main{
public static void main(String[] args) {
System.out.println(replaceSubstring("the dog jumped over the fence", "the", "that"));
}
public static String replaceSubstring(String s1, String s2, String s3){
return s1.replace(s2, s3);
}
}
Explanation:
*The code is in Java.
Create function called replaceSubstring that takes three parameters s1, s2, and s3
Use the replace function to replace the s2 with s3 in s1, then return the new string
In the main:
Call the replaceSubstring function with the given strings and print the result