• 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

Java: Preserve empty string

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a string like this in the xml file:

global.displayString =" Price" + " " ;

Initially using StringTokenizer to split the string. But now I want to preserve the white spaces which exists at the end of the string.

Please suggest.
 
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read the important administrative private message I have just sent you.

CR
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand the question. What exactly do you want to do, what code are you having now, and how is what it is doing different from what you want to have?
 
Kajal Sharma
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a xml file having string as:

global.displayString = "$" + global.price + " ";

In the present scenario while doing various processing in the file ?I am reading data from xml file using String Tokenizer
StringTokenizer attrtokens = new StringTokenizer(RHSStr," ");
taking space as a delimiter.

But now I want some way where I can keep a record of such strings where a long empty string has been added , to avoid any loss of such type of strings.

Hope this explains a little more.
 
Nothing? Or something? Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic