Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the declarations below, using the substr function, which statements will assign First to the name 1 variable and Last to the name 2 variable?

Given the declarations below, using the substr function, which statements will assign "First" to the name1 variable and "Last" to the name2 variable?
string name = "First Last"; // note the space between First and Last
string name1="";
string name2="";
a.
name1= name.substr(1,5);
name2= name.substr(6);
b.
name1= name.substr(1,6);
name2= name.substr(6);
c.
name1= name.substr(0,5);
name2= name.substr(6);
d.
name1= name.substr(0,5);
name2= name.substr(5);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago