String manipulation and character-based logic:
String manipulation and character-based logic:
๐ข String Parsing and Extraction
-
Extract all digits from a given string.
-
Extract all letters from a string.
-
Extract only uppercase letters from a string.
-
Extract only lowercase letters from a string.
-
Extract special characters from a string.
-
Extract digits and return as an integer array.
-
Extract words separated by a comma.
-
Extract domain from an email string.
-
Extract username from an email string.
-
Extract numbers from a string and calculate their sum.
๐ String Modification
-
Replace all digits with
*
. -
Replace all vowels with
#
. -
Remove all spaces from a string.
-
Remove duplicate characters from a string.
-
Replace all occurrences of a word.
-
Replace each character with its ASCII value.
-
Replace uppercase letters with lowercase and vice versa.
-
Insert a dash between every two digits.
-
Add commas after every 3 digits in a number string.
-
Format a string like a phone number:
(123)-456-7890
.
๐ Reversal and Transformation
-
Reverse a string without using built-in methods.
-
Reverse only words in a sentence.
-
Reverse only digits in a string.
-
Reverse string recursively.
-
Reverse vowels in a string.
-
Reverse string ignoring special characters.
-
Reverse every second word in a sentence.
-
Reverse string keeping numbers at original positions.
-
Mirror each word in a sentence.
-
Reverse a string using stack.
๐ Counting Operations
-
Count vowels in a string.
-
Count digits in a string.
-
Count uppercase and lowercase letters.
-
Count special characters in a string.
-
Count number of words in a sentence.
-
Count occurrences of a given character.
-
Count repeating characters.
-
Count each character using a Map.
-
Count the number of lines in a multiline string.
-
Count substrings of a specific pattern.
๐ Validation and Checking
-
Check if string contains only digits.
-
Check if string contains only letters.
-
Check if string is a valid email.
-
Check if string is palindrome.
-
Check if two strings are anagrams.
-
Check if string starts with a vowel.
-
Check if all characters are unique.
-
Check if string is alphanumeric.
-
Check if a password is strong (rules-based).
-
Check if string contains a substring without using
.contains()
.
๐ฆ Splitting and Joining
-
Split a string on commas and print each value.
-
Split camelCase words.
-
Join string array using hyphen.
-
Split file path and get filename.
-
Split URL and extract query parameters.
-
Split a sentence into words and reverse each word.
-
Join two strings with alternate characters.
-
Split string into fixed-size chunks.
-
Join strings using StringBuilder.
-
Split string using multiple delimiters.
๐งฎ Mathematical on Strings
-
Add two numeric strings.
-
Multiply two numeric strings.
-
Check if string is a valid number.
-
Calculate sum of all digits in a string.
-
Find average of digits in a string.
-
Convert Roman numeral string to integer.
-
Convert binary string to decimal.
-
Convert decimal to binary string.
-
Find the largest number in a string.
-
Extract all integers and sort them.
๐งช Character Level Logic
-
Find first non-repeating character.
-
Find last repeating character.
-
Check if a character is vowel or consonant.
-
Print frequency of all characters.
-
Remove all vowels from string.
-
Replace digits with their word form.
-
Print ASCII value of each character.
-
Convert each character to next character (e.g., a→b).
-
Encode string using Caesar Cipher.
-
Find most frequent character.
๐ก Miscellaneous
-
Compress repeated characters (e.g., aaabb → a3b2).
-
Decompress encoded string (e.g., a3b2 → aaabb).
-
Find longest word in a sentence.
-
Find shortest word in a sentence.
-
Check if all words in string are unique.
-
Count capitalized words.
-
Extract initials from full name.
-
Extract hashtags from a social media post.
-
Remove HTML tags from a string.
-
Check if parentheses in a string are balanced.
๐งฉ Custom Logic Based
-
Convert string to title case.
-
Find longest palindrome in a string.
-
Remove duplicates while preserving order.
-
Rearrange string so no same letters are adjacent.
-
Reorder letters alphabetically.
-
Convert a sentence to Pig Latin.
-
Encode string using Run Length Encoding (RLE).
-
Compare two strings ignoring cases and special characters.
-
Highlight a specific word in a string.
-
Extract value from key-value string (e.g.,
id=123;name=Sunil
→ get123
).
Comments
Post a Comment