Home >Java >javaTutorial >How to Capitalize the First Letter of Each Word in a Java String?

How to Capitalize the First Letter of Each Word in a Java String?

Patricia Arquette
Patricia ArquetteOriginal
2025-01-01 11:55:10398browse

How to Capitalize the First Letter of Each Word in a Java String?

Capitalizing First Character of Words in a String in Java

Is there a built-in Java function that can capitalize the first character of each word in a string without altering other characters?

Examples:

  • jon skeet -> Jon Skeet
  • miles o'Brien -> Miles O'Brien (B remains capitalized, excluding

The above is the detailed content of How to Capitalize the First Letter of Each Word in a Java String?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn