Skip to content

ravi-shekhar/StringExtractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Problem Statement
---------------------
Write to a file a single line containing the alphabetical characters, followed by the count of alphabetical characters, then the numerical characters, and finally the count of numerical characters, each separated by a comma.
For example, given the String “12345ABC”, the file should contain the line “ABC,3,12345,5”.


Condition for user input:
------------------------------
1st character of String must be Numeric.
Last character of String must be Alphabet.


How to run the project -
--------------------------
1) Run the main class (StringExtractor.java).
2) Program will ask to enter the valid user input as follows-

   *Note: The input string must start with a number and end with an alphabet. 
   Please enter a valid* string : 

3) For wrong entered input, program will show the following error message-

   ERROR: Invalid input string. It must start with a number & end with an alphabet.
   Please try again.
   ******************

3) For correct entered input, program will show the following success message-

   File Written Success. Please check the file named 'output.txt' at location : C:\POC\StringExtractor\output.txt

   Output written in File as : ioifhifhihfgjh, 14, 23478326487369584545495, 23
   
   Example input - 2347832648736 9584-5 45495= (()^&^%%# io ifhifh ihfgjh



About

Simple project to extract, validate and write a string to file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages