|
I guess farm tractors would be different, too. And bulldozers. And excavators. And ...
|
|
|
|
|
My first car was fitted with a crank. Never used it though, pushing easier.
>64
Some days the dragon wins. Suck it up.
|
|
|
|
|
If the car is located on a flat, clean road: Maybe.
If the reason why the battery is dead is that you have just dug your car out of a meter of snow, where it has been sitting since September and the battery didn't take the cold well, then pushing the car up on the road may be quite a task!
|
|
|
|
|
Yes, if the donors engine has just been started the regulator of the alternator will run at max power to recharge the battery.
If you at that moment connect another drained battery the there will be a power surge before the regulator adjusts that might fuse the diodes on the alternator.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Notepad++ does support something like that since decades
|
|
|
|
|
|
text = text.Trim().Replace( "\n\n", "\n" );
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I think you meant this.
while (text.Contains("\n\n")) {
text = text.Replace("\n\n", "\n");
}
/ravi
|
|
|
|
|
(I think I failed to copy my own code)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
That only works with completely empty lines. For a production system, you'd want a regex that matches 0 or more space/tab characters between the newlines.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
text = text.Trim().Replace( "\n\n", "\n" ).Replace("\t", "").Replace(" ", "");
Anything else?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
That doesn't do what you think it does.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
Props for trying, but I found out he ain't open to suggestion.
Jeremy Falcon
|
|
|
|
|
You'd want something more like this: /^\s*?(?:\r\n|\r|\n)\s*?$/gm . Notice the global modifier, it will help with the newline side of things for the second line.
Jeremy Falcon
|
|
|
|
|
Mine works ... and I can read it.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Yours works only in a very specific circumstance for something you find useful. Yours will leave any extra whitespace and make no distinction between a blank line or line with whitespace. This also means yours cannot be automated.
So, you're welcome.
Jeremy Falcon
|
|
|
|
|
a trivial AWK program would do the trick . or you can utilize regular expressions Find/Replace though i am still uncertain how to handle end of line and new line but am certain it can be done as i have been successful in past though i do not recall the details . a little learning experimentation will no doubt do the trick .
|
|
|
|
|
Props for mentioning regex. Most devs never take the time to learn it, but it's an extremely useful tool.
Jeremy Falcon
|
|
|
|
|
AI is often used where simple if/then's are perfectly appropriate.
But: If you integrate an AI solution then you don't just get an overblown whitespace remover, you open yourself to formatting, syntax checking, code completion, and lots of other stuff that AI is actually great at.
cheers
Chris Maunder
|
|
|
|
|
Every developer should take the time to learn regex. Most of the pesky grep-type problems have already been solved. Besides, AI is too busy focusing on ruling the world.
Jeremy Falcon
|
|
|
|
|
Check the title.
Jeremy Falcon
|
|
|
|
|
Certainly better to use AI for that rather than rely on something that actually mattered.
|
|
|
|
|
You seem like the sort who would use a Nutrimatic machine to simply boil dried leaves.
|
|
|
|
|