Jeremy Lin couldn’t help but feel sorry for himself after suffering a left hamstring injury against the Pistons on Wednesday night that will sideline him for two weeks and maybe longer, just when his new role as the Nets’ starting point guard was off to such a promising start.

But when he got to his locker and saw the pair of pink shoes he had worn that day in honor of a 7-year-old cancer patient named Ava whom he has befriended, he realized there are worse fates in life than a strained hammy.

“At first, I was really upset,” Lin said. “I came back to my locker and I wore those pink shoes that day for Ava. I saw the shoes and started thinking about her, and I immediately ended my pity party. It could be a lot worse. I’m still blessed that I’m going to be back on the court.”

The timetable for Lin’s return is anyone’s guess. Lin was advised to do “a whole lot of nothing” until the injury calms down. He will be re-evaluated in two weeks, which comes just before the end of a four-game road trip that ends Nov. 18 in Oklahoma City. He’s likely to miss at least seven straight games, starting with Friday night’s matchup at Barclays Center against the Hornets.

“It’s hard to tell with hamstring stuff,” said Lin, who has no previous experience with hamstring injuries. “It’s not always easy to know what is a good timeline. They really haven’t said anything other than to keep rehabbing, and in two weeks, we’ll see how you feel and go from there.”

Lin hopes to accompany the Nets when they embark for Phoenix next week, but he’s uncertain if he will be permitted to travel.

advertisement | advertise on newsday

Lin said he was hurt when he planted his left leg awkwardly while driving into the lane and felt a tweak. He was unable to continue after a couple more trips down the court.

Instead, he sat on the bench and encouraged replacements Isaiah Whitehead and Sean Kilpatrick, who moved over from two-guard. Whitehead started Friday night with Kilpatrick in the backup role. Randy Foye returned from a right hamstring injury, but coach Kenny Atkinson was unsure how much time he would get, and Foye wound up not playing.

“I want to see young guys do well,” said Lin, who plans to stay in their ears. “I guess I’ll just talk until Kenny tells me to shut up. I’m learning so much just the first few games playing with these guys. So basically, everything I’ve learned about each player and how I feel the game should be controlled or how we run different things, I’m going to try to give as much as I can to whoever is controlling the ball or is in charge at that moment. I think it’s important for veterans to always continue to talk.”

The injury to Lin obviously is a major blow to the Nets. Atkinson said it will be “point guard by committee,” with forwards Rondae Hollis-Jefferson and Bojan Bogdanovic also bringing the ball upcourt.

“I have to have a mindset and the team has to have a mindset like we’re moving on,” Atkinson said. “I’m disappointed for Jeremy but excited to see Isaiah get an opportunity. In the long run, this could help develop our roster a little more, but we want Jeremy back as soon as possible.”