Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that name variable contains the full name of a person, with the following format: Lastname, Firstname or Lastname, Firstname MidleInitials. Which of the following

Assume that "name" variable contains the full name of a person, with the following format: "Lastname, Firstname" or "Lastname, Firstname MidleInitials". Which of the following expressions will assign a "newname" variable containing the same name, but with the format "Firstname Lastname" or "Firstname MiddleInitials Lastname"? e.g., the name "Sacan, Ahmet" should produce the newname "Ahmet Sacan" and the name "Sacan, Ahmet J." should produce "Ahmet J. Sacan". Assume that the comma character appears only once in the name variable.
There may be more than one correct answer. Select all correct answers.
newname = strjoin( fliplr(strsplit(name,',')),'')
newname = strjoin( fliplr(strip(strsplit(name,','))),'')
I = find(name==',');
newname =[name(I(1)+2:end)'' name(1:I(1)-1)]
I = strfind(name,',');
newname =[name(I(1)+2:end)'' name(1:I(1)-1)]

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago