• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

masked a String

 
Ranch Hand
Posts: 203
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I have a barcode LYL01016278572011000000012 , Now I want that when I print it on console ,Only last 4 numbers should be shown rest all should be XXX , say for example.. XXXXXXXXXXX1212 in the form of masked ..!!
please advise me how to achieve this..!!

I have an rough idea...



but is there any advanced functionality does new java 6 gives us, or any other way..!! please advise..!!

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saral Saxena wrote:Hi Folks,

I have a barcode LYL01016278572011000000012 , Now I want that when I print it on console ,Only last 4 numbers should be shown rest all should be XXX , say for example.. XXXXXXXXXXX1212 in the form of masked ..!!
please advise me how to achieve this..!!

I have an rough idea...



but is there any advanced functionality does new java 6 gives us, or any other way..!! please advise..!!



BTW, I took a shot at answering this topic, with the code from your other topic...

https://coderanch.com/t/572056/java/java/extracting-portion-number-string

Henry
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic