Case conversion
Practice
3.5 (30 votes)
Basic programming
Easy
String manipulation
Problem
88% Success 7432 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are given a string \(S\) in the camel case format. Your task is to convert this string into the snake case format.

Examples of the camel case strings are as follows:

  • ComputerHope
  • FedEx
  • WordPerfect

Note: In the camel case string, the first character may or may not be capitalized.

Examples of the snake case strings are as follows:

  • computer_hope
  • fed_ex
  • word_perfect

Input format

  • First line: \(T\) denotes the number of test cases
  • Next \(T\) lines: String \(S\)

Output format
For each test case, print the snake case format of the given camel case in the string \(S\) in a new line.

Constraints

\( 1 \le T \le 100 \)

\( 1 \le |S| \le 100 \), where \(|S|\) indicates the length of string \(S\)

String \(S\) is made of lower and upper case English alphabets

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
178 votes
Tags:
GeometryHiringApprovedEasy
Points:20
231 votes
Tags:
Easy
Points:30
6 votes
Tags:
ApprovedBinary SearchMathMediumOpenSorting