Routine for Removing Semicolons, Dashes, Quotes, and Commas from a String

Removing Semicolons, Dashes, Quotes, and Commas from a String

Prev Question Next Question

Question

Which of the following best describes routine in which semicolons, dashes, quotes, and commas are removed from a string?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

The routine that removes semicolons, dashes, quotes, and commas from a string is an example of input validation. Input validation is the process of ensuring that the data provided by the user is valid and safe to use within the context of the program.

In this case, the removal of semicolons, dashes, quotes, and commas from the string is intended to prevent SQL injection attacks. SQL injection is a type of attack in which an attacker injects malicious SQL code into a database query in order to gain unauthorized access to sensitive data or to modify or delete data in the database.

By removing semicolons, dashes, quotes, and commas from the string, the input validation routine is attempting to prevent an attacker from being able to insert malicious SQL code into a query. This is because semicolons, dashes, quotes, and commas are commonly used in SQL injection attacks to modify the syntax of a query in order to bypass security controls.

Therefore, the correct answer to this question is C. Input validation to protect against SQL injection. It is important to note that input validation is just one aspect of a comprehensive security strategy and should be used in conjunction with other security measures, such as access controls, encryption, and monitoring, to provide effective protection against attacks.