Given a String, the task is to check whether a string contains only alphabets or not.
[mai mult...]How to add an element to an Array in Java?
Given an array of size n, the task is to add an element x in this array in Java.
[mai mult...]Java Program to Append a String in an Existing File
In Java we can append a string in an existing file using FileWriter which has an option to open file in append mode.
[mai mult...]How to delete a file using Java
To delete a file in Java, use the delete() method:
[mai mult...]How to create a file using Java
To create a file in Java, you can use the createNewFile() method. This method returns a boolean value: true if the file was successfully created, and false if the file already exists. Note that the method is enclosed in a try…catch block. This is necessary because it throws an IOException if an error occurs (if the file cannot be created for some reason):
[mai mult...]How to read a file using Java
In the following example, we use the Scanner class to read the contents of the text file.
[mai mult...]How to read a CSV file using Python
For working CSV files in python, there is an inbuilt module called csv.
[mai mult...]How to delete a folder using Python
To delete an entire folder, use the os.rmdir()
method:
How to delete a file using Python
To delete a file, you must import the OS module, and run its os.remove()
function:
How to create a file using Python?
To create a new file in Python, use the open()
method, with one of the following parameters:
"x"
– Create – will create a file, returns an error if the file exist
"a"
– Append – will create a file if the specified file does not exist
"w"
– Write – will create a file if the specified file does not exist