How to Check if File Exists in C Sharp/C# ?
Hi, Use the following simple lines of code to check whether a particular file exists or not using C#/C Sharp. It will return either True or False depending on whether your file exists or not. ๐
Hi, Use the following simple lines of code to check whether a particular file exists or not using C#/C Sharp. It will return either True or False depending on whether your file exists or not. ๐
Hi, Sometimes you may need to convert string to double using C#, see the following lines of code to see how you could do it. ๐
Hi, Sometimes you may need to get all the characters in a string using C Sharp/C#. The following code gives you an example of how to get or display all the characters of a given string. Output: sampleString[0] = I sampleString[1] = sampleString[2] = L sampleString[3] = o sampleString[4] = v sampleString[5] = e sampleString[6]โฆ Read More »
When run the code the output will be similar to this Total memory is: 5177344 Initial free memory: 4986744 Free memory after garbage collection: 5063784 Free memory after allocation: 5045296 Memory used by allocation: 18488 Free memory after collecting discarded Integers: 5063784
Hi, For converting string to a date in JAVA use the following code. ๐
Hi, Use the following simple lines of code to check whether a particular file exists or not using C#/C Sharp. It will return either True or False depending on whether your file exists or not. ๐
Hello all….. In today’s post I will show you how to create a single selection list in android. Here is the main.xml Now this line in the java file creates the single choice. setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_single_choice, android.R.id.text1, names)); Now this is the full java code
Hi, For replacing a substring in C Sharp/C#, use the following lines of code.
Hi, For creating a new file using JAVA, use the following code.
Hi, Given below is a code snippet which will demonstrate an exception handling in Java with Divide by zero error. ๐
Hi, Given below is a simple concatenation example in JAVA where two strings are joined together to form a single string. And…the output will be.. “CoderzHeaven” ๐
Hi, For searching for a particular substring from a starting index of a string and get the starting index of it in JAVA, use the following sample of code. It will print out the starting index of the substring ‘co’ (the second ‘co’), that is 6. ๐
Hi, For searching for a particular character from a string and getting the index of that particular character, use the following code. It will print out the index of ‘o’, that’s 1. ๐
Hi, In order to sort the elements in a string array in C Sharp/C#, we use the sort() method. Given below is a simple example using sort() method to sort the elements in a string array. It will print out, Sorted string Array: urStringArray[0] = apple urStringArray[1] = coderz urStringArray[2] = heaven123 urStringArray[3] = heaven777โฆ Read More »
Hi, Sometimes you need to check for whether the given string is Palindrome or not. Given below is a sample code to check whether the given string is Palindrome or not using C Sharp/C#. ๐
Hi, We have discussed here copying a file using FileInfo. Now we are going to see how we can do the same without using FileInfo in C Sharp/C#.
Hi, For copying a file using FileInfo in C Sharp/C#, use the following code. For copying a file without using file info check the example given here. ๐
Hi, Use the following code example to read a complete text file using C Sharp/C#.
Hi all….. Splitting a string in android is really easy.checkout the following snippet. Check the Logcat for output. Note: Make sure to put the escape character before the delimiter for splitting,otherwise the output may be each character.
Hi, It will be very useful to know how you can convert a given string into uppercase or lowercase using program. We are going to show you , how to convert a given string into uppercase or lowercase using C Sharp/C#. See the example given below. Output : Lowercase of sampleString : coderzheaven Uppercase ofโฆ Read More »
Hi, Sometimes you may need to check whether two strings are equal or not equal by checking case insensitive. See the example below to see how to achieve the same using C Sharp /C#. Output : heaven and HEAVEN are equal – Case Insensitive! ๐
Hi, Sometimes you may need to get the files from a specified directory using C# / C Sharp. See the sample code on how it works. This code will get you files from the root directory. ๐
Hi, Let’s see a simple example of deleting a file in a folder using c#. sampleFile.Create() will create the file in the specified folder. sampleFile.Delete() will delete the file in the specified folder. ๐
Hi, How can you create a text file in C# and write to it? Sometimes you may need to create a text file using C sharp program. Here is how you can do that. ๐
Hi, In order to access all the items of an array in C#, use the following lines of code. We are using foreach loop to access all the elements of an array in C#. It will print out, Spell: Apple Spell: Ball Spell: Cat ๐