Java Program to get first letter of each word in String

preview_player
Показать описание

(For all updates on Java interview questions and java tutorials join the telegram group)
Search in Telegram with text Java Tutorials if you are unable to join telegram with above link

1) How to read a matrix from console in java?

2) How to remove duplicates from string in java?

3) Write a java program to duplicate characters with number of occurences in java?

4) Write a java program to implement bubble sort part 1?

5) Write a java program to check string is palindrome or not?

6) Write a java program to print floyds triangle?

7) Write a java program to print floyds triangle?





8) How to count number of vowels in a string in java?

9) How to find largest and smallest values in an array in java?

10) Write java program to find duplicate elements in array in java?

11) write a java program to check the input number is prime or not in java?

12) Write a java program to print pyramid pattern of numbers?

13) Write a java program to find missing number in array in java?

14)Write a java program to print numbers in java up to 10 with out using loops?

15) How to sort elements in array in asc and desc order in java?



16) Write a java program to find factorial of a number in java?

17) write a java program to find second largest element in the array in the java?

18) Write a java program to check two Strings are anagrams or not by sorting and comparing strings?

19) Write java program to print Characters count in each word in String ?

20) Write a java program to find reverse of a string in java?

21) Write a java program to add elements in an array in java?

22) Write a java program to find largest of three numbers?



23) Write a java program to print multiplication table?

24) Write a java program to print star pattern?

25) Write a java program to find factors of number from 1 to 100

26) Write a java program to print fibonacci series using loops?

27) Write a java program to print Ascii values of a Character ?

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

Thank you sir for explaining in a such a way that every one can understand

psachithanandareddy
Автор

Following method doesn't use inbuilt 'split' method and uses less additional space.

public class FirstLetterOfEachWord {
public static void main(String[] args) {
String input = "Good morning Everyone";

}

private static String firstLetterOfEachWord(String input) {
StringBuilder sb = new StringBuilder();

char prevChar = ' ';

for (int i = 0; i < input.length(); i++) {
char currentChar = input.charAt(i);

if (prevChar == ' ') {
sb.append(currentChar);
}

prevChar = currentChar;
}

return sb.toString();
}
}

Manikandan-nnbw
Автор

Sir if v want the last character in the each word to upper case what we need to do

gottepavani
Автор

Sir if v want the last character in capitalize what v shd do

gottepavani
Автор

public class FirstLetterOfWord {
public static void main(String[] args) {
String str = "Samah Mahdi Hassan Alwahbani";
String strSplit[] = str.split(" ");
for(int i= 0;i<strSplit.length;i++){

}
}
}

samahmahdi
Автор

package com.string;

public class EachLetterString {

public static void main(String[] args) {

String str="mahendra shravan deore from nashik ";

String[] stringarray=str.split(" ");

for(String ss:stringarray) {
");
}
}

}

mahendradeore
Автор

please sir can you please teach me freely

beeramaishwaryalakshmi
Автор

public class Program
{
static void Main(string[] args)
{
string str = "Learn with KrishnaSandeep";
string[] strArray = str.Split(" ");
string result = string.Empty;
for(int i = 0; i < strArray.Length; i++)
{
for (int j = 0; j < strArray[i].Length; j++)
{
if (j == 0)
{
result += strArray[i][j];
}
}
}
Console.WriteLine(result);
}
}

sainath