Blog Archives

Android File To String

Here’s an example of turning a file into a string, by reading it line by line File file = new File(path); InputStream inputStream = new FileInputStream(file); BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder total = new StringBuilder(); String line; while

Posted in Android, Tips and Tricks Tagged with: , ,

Xcode Printing NSData to NSLog

In Xcode Object-C to print out NSData to NSLog you might run into rubbish output by just outputting the NSData NSLog(@”%@”, myData); And as output something like this: <3c3f786d 6c207665 7273696f etc… This is not rubbish, though it might look

Posted in ErrorFix, Mac, Tips and Tricks Tagged with: , ,

Xcode Object-C NSUrl to NSString

In Object-C to convert back and forth from NSUrl and NSString take a look at this example: NSString *urlstring = [NSString stringWithFormat:@””]; NSURL *url = [NSURL URLWithString:urlstring]; NSLog(@”url = %@”,url); This will first save a NSString, then create a NSUrl

Posted in Mac, Tips and Tricks Tagged with: , , String Compare Not Equal

To compare to string in like many other language you can’t just use the equal sign =¬†You have to use the .equal() function Dim firstString As String = “test” Dim secondString As String = “test” If (firstString.Equals(secondString)) Then ‘

Posted in Tips and Tricks, Windows Tagged with: , , ,

Excel Join Character Strings From Multiple Cells

In Microsoft Office Excel you can join multiple string from cells by using the Concatenate function. Like this: =CONCATENATE(E2,”-“,F2) Here the string from the cell E2, the character “-” and the string from F2 will be joined together. Making a

Posted in Tips and Tricks, Windows Tagged with: , , ,