Ryan Rampersad
Opinions, Thoughts and Ideas - PHP, Java and Javascript
  • Home
  • About
  • Contact
Browse: Home / string

string

Java String Concatenation

By Ryan on October 12, 2009

A question was raised today in my computer science class. The question went something along the lines of:
If you print out two ints joined by a plus sign, are they added or are they printed out separately?
My initial response that if you did something like println(10 + 11); it would print out 1011. I was [...]

Posted in Java | Tagged concatenation, Java, join, string | Leave a response

Java Tips: main(String[] args)

By Ryan on June 24, 2009

A typical java file starts with it’s class name and for beginner programmers, you’ll usually have a public static void main(String[] args) line a couple lines below that class name too.
Many beginner programmers aren’t taught what exactly the String[] args part means though. They’ll learn arrays eventually but they still won’t understand the point of [...]

Posted in Java | Tagged args, command line arguments, Java, main, string, Tips | 1 Response

Hex-Sha1 Hashes in Java

By Ryan on February 26, 2009

No, not a Hash Table. A hash as in sha1 or md5. After a few days of searching and tinkering sometime in December 2007, I wrote this static driven Java Hash file for sha1. So if you want sha1 hashes in your program (for strings and files), this might help you out. At this point, [...]

Posted in Java | Tagged file, hash, hex, Java, plaintext, sha1, string | Leave a response

Stop Input Skipping in Java

By Ryan on December 19, 2008

In Java, there is a particular case where using Scanner can cause a request for input to be totally ignored. I’ve called it the int-skip-string case. Basically, you enter an int using Scanner.nextInt() and proceed to enter a string but just as you’re about to type it, you notice that your chance is gone! And [...]

Posted in Error, Java | Tagged int, Java, newline, nextInt, nextLine, scanner, skip, stop, string | 12 Responses

toUpperCaseAtChar

By Ryan on October 30, 2008

We needed a method today in class that would capitalize a particular character in a string. You decide on the character based on it’s index (from 0 right now, but I don’t know if I’ll keep it that way.)
The method is extremely simple but avoids sub-strings and annoying logic that sub-stringing brings.
Sadly in Java you [...]

Posted in Java | Tagged enhancement, Java, method, string | Leave a response

Recent Posts

  • Setting Build Path has Encountered a Problem in Eclipse
  • Queue Ajax Requests in Mootools
  • CakePHP 1.3 Helper $text truncate error
  • CakePHP – 1and1 – 500 Internal Server Error
  • Easy CakePHP Database Settings Switching

Tags

(fluff)Grabber 2.7 2009 Apple array beta blog blogs Browser Browsers CakePHP chrome CSS Design Error Firefox fluff friends fluff grabber free Google html iGoogle internet explorer Java Javascript mac Microsoft Mootools music PHP plugin plurk program review School SEO solution string tip Tips update vista Windows windows 7 Wordpress

Search

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
QC: