• 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

Introduce an octal 254 separator in between two strings

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ava Gurus,
I need to add an octal 253 character in between a text string. I am not sure how do I acheive this. It would be a great help if someone helps me out in this regard. My code is as under:
Thanks,
Smitha
_________________________________________________________________________
public class OctalTest {
public String getFinalString() {
return "First String" + octal 253 + "Second String";
}
public static void main(String[] args) {
OctalTest ot = new OctalTest;
System.out.println("The Final String is: " + ot.getFinalString());
}
}
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not entirely sure what you mean. Are you wanting to convert the decimal number 253 to an octal number? With Google, I quickly found:
http://mindprod.com/jgloss/octal.html
http://www.janeg.ca/scjp/oper/binhex.html
Search for octal on this page:
http://www.informit.com/isapi/product_id~%7BEA69C2ED-DC6B-4BF6-98C7-188657565E9E%7D/content/index.asp
You might be looking for something like this:
char octal253 = '\253';
My Dr. Java interpreter shows me that that character looks like: �
Whoops--you want 254--that's �
But I suppose I shouldn't necessarily go by that, because there have been times when I've needed the hex 253 character to use as a separator, and it looks like |, but come to think of it, maybe that's just what it got converted to or something, because in the interpreter,
String separatorChar = "\u00fd";
ends up looking like �
Now I'm starting to confuse myself--I wonder how this is all going to display on the page. Anyway, depending on what you want, you should be able to find it pretty easily.
[ November 18, 2003: Message edited by: S. C. Huey ]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
smitha,
Welcome to JavaRanch!! Please change your name to be compliant with JavaRanch's naming policy. It should not be obviously fictitious.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.
Thanks,
Cindy
 
reply
    Bookmark Topic Watch Topic
  • New Topic