Java capFIL function to capitalize first letter of a word or sentence .

capFIL function is a 10-line java code that does one thing for now , and that is capitalizing the first letter of any word or sentence.

What is the benefit of capFIL ?

1. Rewrite user input text .

2. Brings ease with which a reader can understand a written text on your apps

3. Help in raising the readability level of a sentence from mediocre to good

How ?

1. User need not to worry whether they input  correct upper case or lower case at the right place.

Suppose ,a user enter her first name to be “amudA” and last name to be “aDeOlu”, the full name will be written as “amudA aDeOlu “, or imagine a user type “i lovE wriTiNg teXt withOUt lOOkiNg aT mY keyBoArd.” , it will also be written as  “i lovE wriTiNg teXt withOUt lOOkiNg aT mY keyBoArd.

The images below shows how  text can be written on their web apps.

Image title

Image title

Image title

Image title

with java capFIL function ,all names or text with ( bad upper case and lower case ) are written perfectly.

How does it work ?
It work as a public access modifier of a generic static method named capFIL that returns String ,also with an argument of generic type variable , it create and assign a new String variable named firstWS from the method argument which is been tokenize by split(“”) method , it store and convert first occurring letter of the first word into upper case to zero index. The Building of the left character to lower case with good trimming along with the first word makes capFIL function.

Example :

2016-12-17-at-08-27-22

Check capFIL source code here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: