Skip to content

Latest commit

 

History

History
47 lines (24 loc) · 2.55 KB

004_strings.md

File metadata and controls

47 lines (24 loc) · 2.55 KB

Strings

Beginner to Intermediate

  1. Write a program that converts the string into uppercase

  2. Write a program that reads two strings and append first string to the second. So if first string is Good second string is Morning , the program should print MorningGood

  3. Program that reads string and count number of characters present in the string

  4. Write a program that converts string like "124" to 124

  5. Write a program to delete all vowels from a string. Assume string is not more than 80 characters long

  6. Write a program to check whether the string is alphanumeric or not , eg:batman@45 contains digit 45

  7. A program that reads three strings and prints the longest and smallest one

  8. A program that counts number of vowels and consonants in a String?

  9. Write a program which receives a string str that calculates the length of a string and return true if the length is greater than 7 without using strlen()

  10. Write a program that takes two strings and copies smaller string into bigger string

  11. Given a string, determine if it is a palindrome, considering only alphanumeric characters

  12. For a given input string(str), write a function to print all the possible substrings.Without using substr method

  13. Write a program that removes the time from the given date string "Wed April 15, 7pm". It should return only the date without the time.

  14. Write a program that masks all but last four characters of the string "5565534276455423" to '#'

  15. Given a string "tic tac toe is a fun game" convert the first 6 characters to capital case

Advance

  1. Given an input string S and two characters c1 and c2, you need to replace every occurrence of character c1 with character c2 in the given string

  2. Given an input string S that contains multiple words, you need to remove all the spaces present in the input string. There can be multiple spaces present after any word

  3. Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is. example: Input : Welcome to NeoG Camp → Camp NeoG to Welcome

  4. A program that counts the value of each character and prints the most repeated character?

  5. Write a program to toggle case of each character of the string "good afternoon" (example: "neogcamp" ⇒ "nEoGcAmP" )

  6. Given a string "how was your day?" and a word "how", write a program that removes the occurrence of the specified word from given sentence. ( input: string⇒"programming camp are amazing",word⇒ "programming"; output:" camp are amazing")