Giter VIP home page Giter VIP logo

customstring's Introduction

CustomString

This project was for testing my programming skills in java, while studying a java object oriented programming course.

INSTRUCTIONS

In this assignment, you will implement a simple class called ​ CustomString​ . This class represents a more customizable version of a String, with additional attributes and methods.

For example, the CustomString class has a “reverse” method which returns a new string version of the current string where the capitalization is reversed (i.e., lowercase to uppercase and uppercase to lowercase) for the alphabetical characters specified in a given argument. For CustomString “abc, XYZ; 123.”, calling reverse("bcdxyz@3210.") will return "aBC, xyz; 123.".

The CustomString class also has a “remove” method which returns a new string version of the current string where the alphabetical characters specified in a given argument, are removed. For CustomString "my lucky numbers are 6, 8, and 19.", calling remove("ra6") will return "my lucky numbers e 6, 8, nd 19.".

There are 5 methods that need to be implemented in the CustomString class:

  • getString() - Returns the current string.
  • setString(String string) - Sets the value of the current string.
  • remove(String arg) - Returns a new string version of the current string where the alphabetical characters specified in the given arg, are removed.
  • reverse(String arg) - Returns a new string version of the current string where the capitalization is reversed (i.e., lowercase to uppercase, and uppercase to lowercase) for the alphabetical characters specified in the given arg.
  • filterLetters(char n, boolean more) - Returns a new string version of the current string where all the letters either >= or <= the given char n, are removed.

CODE - SOLUTION

You can find the script right here on this repository.

IMPLEMENTATION

Main code for being run

Screenshot from 2023-08-02 11-09-41

Screenshot from 2023-08-02 11-10-01

Output

Screenshot from 2023-08-02 11-10-26

customstring's People

Contributors

ordogeek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.