The Artima Developer Community
Sponsored Link

Java Answers Forum
rotating character of string

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
Sunny

Posts: 1
Nickname: sunny
Registered: Oct, 2002

rotating character of string Posted: Oct 6, 2002 3:18 AM
Reply to this message Reply
Advertisement
here is my problem I am new to java i was wondering how can i solve this issue...

public static String rot13( String str )

method rot13 will rotate the characters of str by 13. That is each letter is shifted 13 places, ie:

To rotate each letter by 13, Check to see if the letter is upper or lower case. Add 13 to the letter, if the result of the addition breaks the range for that case subtract 26


public static int simpleHash(String str )
method simpleHash will sum the ASCII codes of the characters in str and return the result.

Topic: taking directory as a command line argument Previous Topic   Next Topic Topic: how can I use POST in applet and open the result in a browser window?

Sponsored Links



Google
  Web Artima.com   

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