AFTER graduating from Duke University this spring, Karan Sabharwal landed a job in finance in New York City. He had a plan to make Manhattan living affordable.

Danny Moreno of All Week Walls puts the frame up for a temporary wall that will create a bedroom in a New York apartment.

He would lease a nice one-bedroom apartment, convert it to a two-bedroom space with a temporary wall and split the rent with a friend.

But when he went to check out the Rivergate, a high-rise apartment building in Kips Bay, he was told by the property manager that partitions were no longer allowed.

“I told her I had friends in nearby buildings that had put up the walls,” he said. “She said, ‘We have adopted the policy, like many other buildings in the neighborhood, that you will not be able to put up the full wall anymore.’ ”

As the city aggressively enforces a long existent but widely ignored code, walls are falling across Manhattan, radically altering the housing landscape for scores of young professionals. Thousands of renters are being told that the walls that have been put up over the years without approval from the Department of Buildings must come down. And new renters are being informed that if they wish to divide a space, they will need to rely on bookshelves or partial walls that don’t reach the ceiling.

“The impact has already been dramatic,” said Gordon Golub, the senior managing director for rentals at Citi Habitats. “Landlords are all trying to come to some sort of conclusion as to what they are going to do in allowing any walls or a different sort of wall that might go up, and it is affecting brokers and customers.”

Manhattan apartments are as varied as the roommates who decide to share a place. Because of this, there are no rules that apply universally. But in all cases, temporary walls must not block exit routes or interfere with the ventilation and sprinkler systems. And there are minimum requirements for room size.

The current focus on temporary walls is driven by two developments: prosecutors’ decision to level manslaughter charges at the owners of a building where a fatal fire occurred in 2005 and, more recently, the city’s drive to eliminate illegally installed temporary walls in Stuyvesant Town, the sprawling complex between 14th and 23rd Streets on the East Side.

After tenants’ complaints and subsequent inspections by both the Fire Department and the Department of Buildings, Tishman Speyer, the owner of Stuyvesant Town, embarked this spring on a review of all its apartments and moved swiftly to eliminate all walls that were not up to city code.

“It was determined that partition walls previously installed in some apartments were not in compliance with the New York City Building Code,” the company said in a statement. It declined to go into the extent of the complaints or who had lodged them.

Tishman Speyer is paying for the removal of the walls. It is also footing the bill for the installation of approved replacement walls for those tenants who had the landlord’s permission to build temporary walls.

City officials note that it has long been illegal to install a floor-to-ceiling wall without a permit from the Department of Buildings, even though landlords as well as tenants have often disregarded this requirement. But the strict enforcement at Stuyvesant Town has prompted many landlords to get into compliance.

The Manhattan Skyline Management Corporation, which manages thousands of luxury apartments across Manhattan, including the Rivergate, has been examining its entire portfolio to establish where walls were erected. The company has already informed hundreds of residents that even if they installed walls with the building’s approval, or moved into an apartment that already had such walls, they will have to rip them out if they are not up to code.

In a statement, the company said that because the Department of Buildings had “greatly restricted” the use of walls to subdivide rooms, “previously installed walls which were believed to be legally installed have to be removed.”

The company is offering tenants who erected walls with its approval $700 to help defray the cost of erecting new dividers, like bookshelves.

But for many residents, a bookshelf or a partial wall is no substitute.

“It’s not only inconvenient, but heartbreaking, since we love our apartment just the way it is,” said Daniela Zakarya, 25, and a broker at the Real Estate Group of New York.

Ms. Zakarya, who moved with her college roommate into a Gramercy-area apartment a year ago, said the wall had been in place at the time. She was informed in April by her landlord — whom she did not want to identify since she is still negotiating a solution — that the wall had to come down.

Karan Sabharwal, right, apartment-hunting with his mother, Rachna, tries to envision a partial wall in a place downtown.

A week later it was removed, and now the living room has become the second bedroom while the roommates decide what to do next.

“It is a cataclysmic change and is the future of Manhattan share situations,” she said.

Ms. Zakarya quickly realized she was not alone. Many of her clients are young professionals looking to share places in doorman buildings where the average rent for a one-bedroom ranges from $3,000 to $3,500. As she has shown apartments in recent weeks, she said some potential renters have been surprised to find that the cost-saving room-splitting arrangements their friends made just a year ago are no longer an option.

And the bookshelves, screens and partitions replacing walls inevitably result in a loss of privacy.

“Everyone who wishes to save money on rent and convert their apartments may need to get used to this,” Ms. Zakarya said.

Tony Sclafani, a spokesman for the Department of Buildings, said the city’s regulations had not changed. He emphasized that a work permit had always been required to add a wall.

“The addition of a partition, pressurized wall, or other floor-to-ceiling divider, even if intended as a temporary installation, results in a change to the layout of an apartment,” he said.

To get a work permit, one must hire an architect or engineer to prepare plans of the proposed layout and other construction details as well as to apply for plan approval, Mr. Sclafani said. After the plan is approved, the contractor must get a work permit. After the work is complete, the architect or engineer must inspect it and then sign off on the job at the Department of Buildings.

Certainly, thousands of renters have skirted these rules in the past without penalty. The Department of Buildings does not randomly inspect residences, and mostly acts in response to complaints.

But ever since a deadly fire in a Bronx apartment building in 2005 in which two firefighters died after leaping from a window, the city has had illegal room dividers in its sights. Prosecutors charged the building’s former and current landlords, as well as two tenants, with manslaughter. The city’s position was that illegal partitions erected by the tenants to subdivide the apartments had disoriented the firefighters and led to their deaths.

The tenants, who were said to have installed the partitions to create small, windowless rooms that they then rented out for $75 to $100 a week, were acquitted.

The owner and former owner were convicted of criminally negligent homicide by a separate jury. But that verdict was overturned in February by the State Supreme Court, which found the prosecution had failed to prove the defendants had known about the illegal partitions.

Since that fire, the Department of Buildings has cracked down on the most dangerous situations, issuing 1,200 vacate orders in 2009 for people living in illegally subdivided apartments, the majority in Queens. Manhattan shares drew little attention until recently, when landlords and real estate agents could not help hearing the rumble of walls falling in Stuyvesant Town.

Because apartment layouts vary widely, it is difficult to generalize about what types of walls meet with city approval, but officials at the Department of Buildings said the major considerations had to do with “egress routes” to ensure “maximum travel distances in the building code are not impeded, sprinkler coverage areas (where sprinklers are provided) are not obstructed, smoke detectors and carbon monoxide detectors are relocated or supplemented if necessary to comply with the building code.”

Any electricity work must also meet guidelines.

“Keep in mind that the elimination of a common living room to create a three-bedroom, zero living room apartment may result in a rooming-unit situation that is not permitted by the Housing Maintenance Code,” Mr. Sclafani said. “In addition, since each apartment is generally required to have at least one room of at least 150 square feet, the installation of a partition may run afoul of this requirement in certain cases.”

He said anyone with questions about whether an apartment is up to code can call 311 and request an inspection by the Department of Buildings.

In any case, despite the firm stance taken by some major property owners, thousands of renters are still using pressurized walls, which are relatively inexpensive, easily installed and easily removed.

Donny Zanger, the project manager at All Week Walls, which specializes in installing and removing pressurized walls, said his business was so far unaffected.

“We are growing like crazy,” he said.

“If these walls did not exist in New York,” Mr. Zanger said, “it would be a very difficult situation for students and young professionals and even professionals who make more money.”

He says he follows all the city codes and regulations when installing a wall. He also says he does not understand how erecting large bookshelves to divide a space is any safer than properly installing a pressurized wall.

In practice, it has not been the responsibility of the installation companies to obtain the necessary building permits; it has been the landlord’s or the owner’s. But many companies use their Web sites to advise potential customers to secure approval from building management.

The cost of a wall starts around $700, and Mr. Zanger said his company had put up 300 to 400 walls in the past year. There are dozens of similar companies — a testament to just how common the practice of dividing rooms in Manhattan has become over the years.

It remains to be seen whether many landlords will follow the lead of Stuyvesant Town and other major property owners in Manhattan, but during a June meeting of landlords and brokers hosted by the Real Estate Board of New York, it was the hot topic.

Meanwhile, many renters new to the city find themselves in a position similar to that of Mr. Sabharwal, the Duke graduate.

“I heard that if you have a month, that is plenty of time to find something,” he said. But in light of the crackdown on temporary walls, his options seem more limited and he might have to reassess his $1,600 budget.

“It is a whole different experience than my friends had,” he said.