The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to Use Code Point Methods of Java String get Unicode Characters Example Tutorial

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to Use Code Point Methods of Java String get Unicode Characters Example Tutorial Posted: Jan 6, 2012 8:39 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to Use Code Point Methods of Java String get Unicode Characters Example Tutorial
Feed Title: Javarevisited Blog
Feed URL: http://javarevisited.blogspot.com/feeds/posts/default?alt=rss
Feed Description: Blog on Java, Unix, Linux, FIX Protocol technology. I share my experience as tutorial, article, interview questions, programming, design etc.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Javarevisited Blog

Advertisement



CodePoint method in String is used to get Unicode code point value at index or before index.  In String class we have lot of utility methods for dealing with String like Split , replace and SubString method but here I am discussing a relatively lesser known method codePointAt(), codePointCount() and codePointBefore() ,but before going deep about this method lets first understand what is of code point ,what exactly CodePoint method does and how to use CodePointAt, CodePointBefore methods using java code example.

What is CodePoing in Java?

Java String CodePoint Get Unicode Characters example tutorialCode points are the numbers that are used in coded character set where coded character set represent collection of characters and each character will assign a unique number. This coded character set define range of valid code points. Valid code points for Unicode are U+0000 to U+10FFFF.

What CodePoint method of Java String does?


Syntax of the method:
Public   int codePointAt (int index): this method returns the Unicode value of the character specified by the index. This method throw IndexOutOfBoundException if index passed as argument is negative or less than the length of the string.

So now we clear from the syntax that what we need to pass as argument of the method and what it will return.. Now why we need the Unicode value of a particular character so the answer would be Unicode is the character encoding standard designed to clean up the mess of dozens of mutually incompatible ASCII extensions and special encoding and to allow the computer interchange of text in any of the world's writing systems.
Unicode has wide spread acceptance as we know computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers. No single encoding could contain enough characters.

So in short Code Point method helps us to get the Unicode value of particular character which in turns helps in internationalization and localization, Unicode is an international character set standard which supports all of the major scripts of the world, as well as common technical symbols.

Related Java Tutorial

Read: How to Use Code Point Methods of Java String get Unicode Characters Example Tutorial

Topic: The Architecture Spike Kata Previous Topic   Next Topic Topic: JAXB, SAX, DOM Performance

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use