Menu
  • HOME
  • TAGS

Java - printing one character at a time using recursion

java,recursion,newline

When you return a string at that time use new line for the string returned in display function something like this return x.substring(x.length()-1-i)+"\n" + displayStuffR(i+1,x); and update your if condition to i < x.length()-1...

BufferedWriter is not writing a new line in a file for a String having “\n” added to it

java,string,swing,newline,bufferedwriter

Use instead BufferedWriter.newLine() which: Writes a line separator. The line separator string is defined by the system property line.separator, and is not necessarily a single newline ('\n') character. ...

try to delete LF in python or notepad++ but cannot use “find&replace” to find it by “\n”,

newline,eof

You need to check extended mode. Currently your text editor is in "normal" mode. You can change the mode with the option selects at the bottom of the search window. When you check extended mode you can search on characters like \t\r\n and replace them. When you are in normal...

Newline and / or Carriage Return in Swift String

ios,swift,uitextview,newline,carriage-return

UITextField is generally single-line and does not support multiline text. Use a UITextView instead

How to remove both whitespace and new line in Regex

regex,newline,whitespace

Instead of adding a space character and following it with optional whitespace, you can use: Function:\s+(.*) \s matches any white space character, + means match the preceding "one or more" times....

Django: show newlines from admin site?

python,html,django,newline,textfield

Use the linebreaks template filter.

Including break line in sed replacement

regex,bash,sed,newline

It can be painful to work with newlines in sed. There are also some differences in the behaviour depending on which version you're using. For simplicity and portability, I'd recommend using awk: awk '{print /FOUNDSTRING/ ? "replacement \"text\" for\nline" : $0}' file This prints the replacement string, newline included, if...

C++ Can an fstream object be set to automatically write a newline on each call to <

c++,newline,fstream

No, there are no readily configurable capabilities of that sort within the standard streams. You may have to subclass the stream type and fiddle with operator<< to get this to work the way you want, or do it with a helper function of some description: fstreamObject << nl("New message."); (but...

`git add` adds ^M to the end of every line

git,vim,special-characters,newline,add

Are you files being checked in from a Windows computer at any point? Windows adds CR+LF to line endings, while other OS's use LF only. If you've set core.autocrlf to false then git diff will highlight CR characters as ^M. To turn this off, you can alter the core.whitespace setting:...

Python: How to write a list of strings on separate lines but withot a blank line

python,file,newline

You've said in the comments that python is writing two carriage return ('\r') characters for each line feed ('\n') character you write. It's a bit bizaare that python is replacing each line feed with two carriage returns, but this is a feature of opening a file in text mode (normally...

How to prevent django forms removing newline characters

python,django,forms,newline,eol

you just need linebreaksbr {{ value|linebreaksbr }} ...

setStringValue in NSTextField will always change height

cocoa,constraints,newline,nstextfield

This is happening because you have set the auto layout of textfield with respect to the view. So just fixed the height of your textfield by clicking on the height checkbox like that below :-

Android: New line character from mysql does not work in textview

android,mysql,newline

use msg.replaceAll("\n","<br />"); then on the text view use myTextView.setText(Html.fromHtml(msg)); ...

Word count not working when entering new line

c#,split,newline

txtReader.ReadLine(); strips your newline away. From the msdn: The string that is returned does not contain the terminating carriage return or line feed. so you have to add it manually (or just add a space) textLine = textLine + txtReader.ReadLine() + " "; consider using the StringBuilder class for repeated...

Java - An extra character in my code?

java,char,console-application,newline,scanning

You're running on a Windows system. The code doesn't handle a newline in the form of \r\n, just \n. I was able to produce output that makes sense with this change. Add this case to the switch: case '\r': return String.format("%6d %-6d " + " winNewline", lineIndex, columnIndex); Resulting output:...

Android - Achieving line break in XML string with String.format()?

java,android,xml,newline,string-formatting

Try this for HTML string: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">Hello&lt;br /&gt;World!</string> </resources> ...

How to have line breaks in text/plain servlet response

java,servlets,browser,newline,plaintext

Sorry, once again it was my mistake. We have a compressing Servlet Filter configured which removed the linebreaks. Without that filter \n works just fine....

Why doesn't multiple `\n` characters end up in the standard input stream?

c,newline,stdin,scanf

A skipped character is not "left" in the stream. The input stream can only be read once and in one direction,1 so once a character is skipped, it's gone. 1 without extra fanciness, such as buffering...

Detect new-line character for auto enter new line text on UITextView on iOS

ios,uitextview,newline

The UITextView doesn't automatically enter a newline character once its text reaches the end of the line -- it simply wraps around with a line break. But if you want a string representation of the UITextView text which includes newline characters to indicate the various line breaks, try this: //...

C - Making sure user input is of appropriate length

c,newline,fgetc

You said: What is giving me trouble is checking when they could either enter no characters, up to n amount, or too many. My suggestion: If you are expecting to see at most N characters, create an array whose size is larger than N+2. You need at least N+2 just...

What is the correct newline to use with text/plain ContentType?

http,newline,content-type

RFC 2046 section 4.1.1 says: "The canonical form of any MIME "text" subtype MUST always represent a line break as a CRLF sequence. Similarly, any occurrence of CRLF in MIME "text" MUST represent a line break. Use of CR and LF outside of line break sequences is also forbidden." To...

Remove new lines after echoing HTML from PHP

php,wordpress,replace,newline

<ul class="author-meta"> <?php if (get_the_author_meta('url', $theID)) { $output = '<li class="url"><a href="' . get_the_author_meta('url', $theID) . '" title="">Website</a></li>'; } if ( get_the_author_meta('twitter', $theID)) { $output .= '<li class="twitter"><a href="http://twitter.com/' . get_the_author_meta('twitter', $theID) . '" title="">Twitter</a></li>'; } if ( get_the_author_meta('instagram', $theID)) { $output .= '<li class="instagram"><a...

Remove first line in JSON response

objective-c,json,string,newline

// Assuming your string looks something like this NSString *fileContents = @"Bob Smith: 1 (234)-567-8901\nBob Smith: [email protected]"; // Lets store the information on each new line in an array NSArray *lines = [fileContents componentsSeparatedByString:@"\n"]; // The second object will contain the email NSString *email = [lines objectAtIndex:1]; NSLog(@"%@",email); ...

print on newline with csvwrite in Scilab

newline,scilab

Because time is a column vector and use that for the creation of timetimestwo, this will also be a column vector. In your csvWrite call you transpose the matrix with ', see quote character documentation. So simply removing ' character, will result in a non-transposed and thus column vector in...

Java - how to select by attribute value that contains new line

java,xpath,newline

Unlike element content, attribute values are normalized. Any sequence of whitespace characters (including '\n') is converted to a single ASCII space for the purpose of any XML processing. So, effectively, your XML is really: String xml = "<root text=\"hi ho\"> </root>"; On the other hand, character entities are not normalized....

Splitting text in textarea by new lines (including empty lines) into javascript array

javascript,jquery,arrays,split,newline

Your .split will include \n, but when line is falsey you can just push an empty string... $(function(){ var lines = []; $.each($('#data').val().split(/\n/), function(i, line){ if(line){ lines.push(line); } else { lines.push(""); } }); console.log(lines); }); Here is a working example : JSFiddle Output: ["I like to eat icecream. Dogs are...

PHP - checking for unicode characters - doesn't work with newlines?

php,regex,unicode,newline

In the second attempt, you're trying to assign the call to a variable, don't ... var_dump(preg_match('/\p{L&}/', "\n")); // int(0) Also, you can just use \pL instead and be sure to enable the u (unicode) modifier ... function containsLetters($str) { return (bool) preg_match('~\pL~u', $str); } ...

Can you cout an entered newline character (C++)?

c++,newline

You would have to process the input string yourself. A simple implementation would be like follows: std::string UnescapeString( std::string input ){ size_t position = input.find("\\"); while( position != std::string::npos ){ //Make sure there's another character after the slash if( position + 1 < input.size() ){ switch(input[position + 1]){ case 'n':...

Notepad++ wierd bug? when replace a huge string

regex,string,newline,notepad

You can just replace \r\n with nothing, and that will remove the line breaks. To remove any character that is not [a-z][A-Z][0-9]["|'], replace [^A-Za-z0-9"|'] with nothing. But be careful that you've thought of everything you do want to keep: spaces, tabs, other punctuation, etc....

java - newline detection in strings

java,string,newline

You can use the regex pattern ^(.*)$ together with the modifier Pattern.MULTILINE. A method that checks if a string contains any new line character would look like this: static boolean containsNewLine(String str) { Pattern regex = Pattern.compile("^(.*)$", Pattern.MULTILINE); return regex.split(str).length > 0; } It splits the string in n parts,...

Syntax error near unexpected token 'newline' while reading data from file [closed]

c++,file,syntax,newline

You have to actually write to the standard input. Try one of these: ./programme < input.txt On Unix: cat input.txt | ./programme On Windows: type input.txt | programme ...

Can I put strings divided by newlines into an array using the read builtin?

arrays,string,bash,newline,delimiter

It turns out that your answer is wrong. Yes, you can! you need to use the -d switch to read: -d delim The first character of delim is used to terminate the input line, rather than newline. If you use it with an empty argument, bash uses the null byte...

how to print a certain amount of results on a single line

arrays,perl,count,format,newline

change print join(' ',%scount), "\n"; to: my $n; print map {$n++; $n % 10 ? "$_ $scount{$_} ":"$_ $scount{$_}\n"} keys %scount; ...

HTML POST insert line break in parameters

java,html,post,line,newline

I'm not sure if this is an encoding error or what the default encoding method is for HttpURLConnection, but perhaps its not properly encoding the \n. I believe the ASCII line feed is %0A Perhaps try using URLEncoder.encode(code) ...

Parsing XML Python

python,xml,parsing,xml-parsing,newline

This is called a tail of an element: The tail attribute can be used to hold additional data associated with the element. This attribute is usually a string but may be any application-specific object. If the element is created from an XML file the attribute will contain any text found...

New line and dollar sign in Java regular expression

java,regex,newline

Your regex does not match the input string.In fact, $ matches exactly the end of string (at the end of line3). Since you are not using an s flag, the . cannot get there. More, the $ end of line/string anchor cannot have ? quantifier after it. It makes no...

Android: Having trouble with newline in TextView inside BaseAdapter

android,textview,newline,baseadapter

Try: message = message.replaceAll("\\n", "&#10;"); or (only if there really are double backslashes in the input) message = message.replaceAll("\\n", "&#10;"); Update: Replacements were not working as the search string (\n) had been stripped out (escaped) by the sql database. This answer supplied a workaround which involves running unescape on the...

New line in different languages [closed]

java,newline,pascal,eol

I think the infinite loop (writing hundreds of ones) is because you never read anything from the input so it is never at the end-of-line. Try putting a read(input,ch); in the loop.

How to print newline to file php

php,newline

Ou, I found slution after two hours, it is simple. Just add this $content = str_replace("\n","\\n", $content); ...

Text file io and newline

java,file-io,newline

While calling the second method i.e oddFile() try to put a new line character \n before writing into the file. This will enter all the odd numbers into a new line. write2.write("\n"); While retrieving the data from file use a while loop with a condition as String s=null; while((s=buffer.readLine())!=null) {...

C - Write in plain text file struct variables in newline

c,file,struct,newline

This is what you actually need. #include <stdio.h> #include <stdlib.h> int main() { typedef struct { char cp[1 + 1 + 4]; char id[1 + 1 + 2]; char correlative[1 + 1 + 6]; char digit[1 + 1 + 1]; } log; /* I add `1' for the terminating null...

Newline characters disappear after uploading a txt to a server

javascript,d3.js,newline,xss,plaintext

Your server is probably trying to sanitize the strings it receives from the UI in order to prevent things like cross-site attacks. Trying to escape the string you send to the server with encodeUri(str) and if you need to decodeUri(decodedStr)

Restrict EOF on newline java

java,newline,bufferedreader,eof

Probably the best way to do this would be to just check the length of the input before doing anything. So: if(line.length() > 0) { //do whatever you want } ...

Inserting new lines into innerHTML output

javascript,html,tags,newline,line-breaks

Alternative to .innerHTML .textContext isn't perfect but you can use it fine in this case: var text = document.getElementById("div").textContent; Solution Replacing with newlines: text.replace(/(img\/|script)\>/ig, '$1>\n') With breaks: text.replace(/(img\/|script)\>/gi, '$1>\<br/>') RegExp ( <- Start capturing group img\/ <- Select img\ | <- OR script <- Select script ) \> <- Matches...

Can printing cout << '\n' garble text output?

c++,newline,cout

Your text file most likely has line endings as CRLF (\r\n). When you output CR, it will move the cursor to the beginning of the line. In essence, you're first writing 'Found an illegal character \"', then moving the cursor to the beginning of the line and writing the rest...

How to count empty lines inside a string in javascript

javascript,arrays,regex,newline

If you enable multi-line mode, m, for your regular expressions, you can match empty lines, ^$, and count how many matches have been found. Note that [ \t]* will match zero or more spaces or tabs. function count_lines(text){ return text ? (text.match(/^[ \t]*$/gm) || []).length : 0; } This should...

Sentence is not taking /n

css,newline,word-wrap

Check This: The working solution please replace &lt;/br&gt; with <br/> <p id="Stage_Scrolls_MessageBox_message_box_Text" class="Stage_Scrolls_MessageBox_message_box_Text_id" style="position: absolute; margin: 0px; left: 12.61%; top: 23.18%; width: 165px; height: 157px; right: auto; bottom: auto; font-family: abel; font-size: 21px; font-weight: 400; color: rgb(166, 33, 36); text-decoration: none; font-style: normal; word-wrap: break-word; text-align: center; -webkit-tap-highlight-color: rgba(0, 0,...

preventing emacs from newline insertion

emacs,newline

As pointed out in the comment, the newline comes from the 'date' command itself. You need to find a way to make the command omit the final newline, one way to do it would be the following: C-u M-! echo -n "`date`" in which we use that 'echo' allows you...

Read line by line of a file in shell script where last line doesn't end with new line

file,shell,newline

If your text line doesn't have an ending newline then you can do this at start of your script to force a newline in it: echo '' >> /mnt/Share/hpsum_build.txt You can also call dos2unix utility to remove DOS's \r before \n from each line....

PHP: trying to get fgets() to trigger both on CRLF, CR and LF

php,newline,fgets,proc-open

Use a stream filter to normalize your new line characters before consuming the stream. I created the following code that should do the trick based on the example from PHP’s manual page on stream_filter_register. Code is untested! <?php // https://php.net/php-user-filter final class EOLStreamFilter extends php_user_filter { public function filter($in, $out,...

Laravel 5 adding HTML to email

php,html,email,laravel,newline

You need to specify html key in the first parameter: Mail::send(['html' => 'emails.newinvoice'], ['text' => $emailtext], // ^^^^ Also replace auto-escaped block {{{ }}} with unescaped {!! !!} in the template: <p>{!! $text !!}</p> ...

Newlines not appearing as expected in vCard created in php

php,apache,newline,vcard

The reason for this is that php removes newlines after the php closing tag ?>. There are several ways to work around this. you could for example append a blank space after the closing tag or add an additional newline after the closing tag or you could echo the whole...

Match to the end of the string in PHP

php,regex,newline

Use the D modifier: D (PCRE_DOLLAR_ENDONLY) If this modifier is set, a dollar metacharacter in the pattern matches only at the end of the subject string. Without this modifier, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). $pattern...

c# adding new lines to a console above old lines

c#,console,newline,lines

IMHO mixing normal "stdio" output and cursor / window / buffer manipulation not a good idea, but anyway. Try this: static void Main(string[] args) { int top; Console.WriteLine(); Console.Write("Type here: "); Console.WriteLine(); for (int i = 0; i < 99; i++) { Console.WriteLine("hi" + Environment.NewLine); } top = Console.CursorTop; Console.MoveBufferArea(0,...

Need to pass string with newline character from Unix shell script to sql query

shell,unix,scripting,newline,sqlplus

UPDATED MY ENTIRE SOLUTION DESIGN After trying all night, i have given up. Thanks Aaron and mplf for your inputs. I have decided to change my solution from file based to table based. I will be reading the partner.txt file and inserting the partners in a dummy temporary table. Then...

HTML cannot create a new line break

html,newline

Remove the attribute align="left" in the table tag

php files newlines missing [duplicate]

php,ftp,ide,newline

Check the type of end-of-line / newline character being inserted by your IDE. I had a similar problem with Notepad++, and the setting to change was: Edit >> EOL Conversion >> (and in my case I has to set it to Windows Format)...

writing new lines in a file in perl

regex,perl,file-io,newline

Change the line: $newlines = $newlines.'\n'.'Bounding box for object '.$objnum.' "PAScar" (Xmin, Ymin) - (Xmax, Ymax) : ('.$x1.', '.$y1.') - ('.$x2.', '.$y2.')'; to: $newlines = $newlines."\n".'Bounding box for object '.$objnum.' "PAScar" (Xmin, Ymin) - (Xmax, Ymax) : ('.$x1.', '.$y1.') - ('.$x2.', '.$y2.')'; I.e. you need to but \n in double...

Opening php files shows a lot of blank lines, how do I correctly fix their appearance [closed]

php,notepad++,newline,notepad,carriage-return

How about: Find what: (\R)\1+ Replace with: $1 Where \R stands for any of \r, \n or \r\n. This will replace 2 or more line break, no matter what it is, by only one....

How do I replace newlines only between numbers and a sentence?

linux,awk,sed,newline,digits

An awk: awk '/^[0-9]+\.[0-9]+/{printf "\n"}{printf $0}' filename For handling DOS line breaks: awk '{sub(/\r$/,"")}/^[0-9]+\.[0-9]+/{printf "\n"}{printf $0}' filename Demo: $ awk '{sub(/\r$/,"")}/^[0-9]+\.[0-9]+/{printf "\n"}{printf $0}' filename 0 15.239 23.917 Reprenem el debat que avui els oferim entorn de les perspectives d'aquest dos mil set. &lt;ehh&gt; Estavem parlant concretament dels temes 30.027 de...

Replace all newlines between “two lines with certain patterns” with a comma in vim

regex,vim,newline

How about :%s/Pattern 1\_.\{-}Pattern 2/\=join(split(submatch(0), "\n"), ", ")/g Search Pattern 1 # obvious \_. # any character including newline \{-} # repeat non-greedily (vim's way of writing *?) Pattern 2 # obvious The replace part should be clear without an explanation....

How do I include new lines in a string in Perl?

string,perl,newline

I'd do: my $str = 'Acanthocolla_cruciata,#8B5F65Acanthocyrta_haeckeli,#8B5F65Acanthometra_fusca,#8B5F65Acanthopeltis_japonica,#FFB5C5'; $str =~ s/(?<=,#\w{6})/\n/g; say $str; Output: Acanthocolla_cruciata,#8B5F65 Acanthocyrta_haeckeli,#8B5F65 Acanthometra_fusca,#8B5F65 Acanthopeltis_japonica,#FFB5C5 ...

Why when i loop a \n in an ' ' char + a number it counts wrong [closed]

java,for-loop,char,newline

The ASCII value for \n is 10. The + operator is being interpreted as an "add" operand between two numeric values, not as an "append" operation between two Strings. This is because you are using single quotes, not double quotes. Single quotes indicate a char. A char can be treated...

How to post figures on a new line in php?

php,newline,figure

It is a simple HTML issue and has nothing to do with php, but even if you code HTML in php you could just use the <br> tag for line break. By the way, it is considered a good practice to keep all HTML tags (<a>) and attributes (href="") in...

how to insert new line in vimscript substitiute function

function,newline,vim,substitute

The easiest way: function! ParseLine() exec 's/,\s*/,\r/g' endfunction Or if you want to first call substitute() then "set" that line: function! ParseLine() let parsedLine = substitute(getline('.'), ',\s*', ',\n', "g") let o = @o let @o = parsedLine normal! V"op let @o=o endfunction ...

Is it possible to test for two new line characters in a row?

c,newline,c89

It seems that your are running your program on windows. In windows, end of line is represented by '\r\n'. So when you check for c and cOld, they will not hold '\n' simultaneously. Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. DOS uses...

Erlang, how can I create text file with newlines?

file,erlang,newline,writefile,erl

I'm guessing you're running your code on Windows, and so you need "\r\n" as the line separator. You can get the line separator appropriate for the platform you're on by calling io_lib:nl/0. Try this instead: write() -> Data = ["1","2","3"], LineSep = io_lib:nl(), Print = [string:join(Data, LineSep), LineSep], file:write_file("/Documents/foo.txt", Print)....

PHP/MYSQL replace n with newline

php,mysql,newline

Store it as it is but escape first with real_escape_string real_escape_string converts what is a newline into the 4 character string '\n\r' $text = $mysqli->real_escape_string($text); ...

Line breaks in phpStorm are removed

php,ftp,newline,phpstorm

I have found a solution for this. The line breaks were not in windows format. In phpStorm, this was solved like this: Select a file or directory in the Project tool window. Choose File | Line Separators on the main menu, and then select the desired line ending style from...

python ConfigParser: read configuration from string

python,string,replace,newline,configparser

This should work. It was a unicode error. Next time please show the stack trace result = u""" [section 1] var1 = 111 var2 = 222 """ print repr(result) config = ConfigParser.ConfigParser(allow_no_value=True) config.readfp(io.StringIO(result)) print config.get("section 1", "var2") print config.get("section 1", "var1") output: u'\n[section 1]\nvar1 = 111\nvar2 = 222\n' 222 111...

vim change newline into space but not every nth-line

vim,newline,substitution

I'm not 100% sure I grok what you're after, but I'll give you a few hints and perhaps they'll help. To join lines together you can use J (that's capital J or Shift-J). You can precede this with a number, such as 10, and join 10 lines together. For example,...

What are the safer and correct alternatives to deprecated `Data.ByteString.Lazy.putStrLn` and why?

string,haskell,unicode,io,newline

The deprecated putStrLn assumes it knows how to encode the '\n' character. None of the other functions you listed assume anything about encoding; they just hand off the bytes you pass them. (It is your job to ensure those bytes are correct for the encoding you intend to use.) I...

Forcing a newline in the css when calling a stylus user function

css,css3,newline,stylus

You cannot control output of blank lines in Stylus (obviously, except --compress flag), and, generally, in all other preprocessors too. Postprocessors (like PostCSS or Rework) and tools like CSSComb are more suitable for your task.

Google Apps Script New Line Loss of Formating

email,google-apps-script,newline

The email is formatted as html. If you change your '\n' to '<br>' it will break the lines. This was my test: MailApp.sendEmail("[email protected]","[email protected]" , "Subject", "This<br>Is<br>The<br>Body"); ...

A bash command that adds newlines to *.cpp and *.h (or any specified filetypes)?

bash,append,echo,newline

This doesn't win any beauty awards, but it's explicit and functional at least, and matches the requirements exactly (only adds newlines to files that are not empty and that do not end with a newline): for f in *.cpp *.h; do if [[ $(tail -c1 "$f"; echo x) =~ [^$'\n']x...

Java 8 programming: Reading a .ini-file and trying to get rid of newline-characters

java,newline,ini

Your problem is that you need to esacpe \ in Java Strings and in regular expressions, so you need to escape them twice. This means if you want to get rid of empty lines you have to write it like this: file = file.replaceAll("\\n+", "\n"); If you know that a...

File output overwrites first line - C++

c++,file,logging,output,newline

You're opening the file for writing each time, which overwrites any existing content. You should either (a) open the file outside of that function, possibly by making the ofstream object a class member, and then your function will simply append to it, or (b) open the file for append, like...

Put linebreak/newline in tooltip

jsf,tooltip,newline

It's not a good idea to name the problem "Concatenating strings in EL" if your issue is with neither of those things. You want to create a multi-line title, that's an HTML problem. Title only accepts text so <br/> will not work but you can put a line break (&#13;)...

Getting weird results in array-cleanup function

php,arrays,preg-replace,newline,associative-array

In your for loop, use $allFeeds[$cnt]['feed_status'] = br2nl($allFeeds[$cnt]['feed_status']); instead of $allFeeds[$cnt]['feed_status'] = br2nl($value['feed_status']); ...

Add new line within textbox and label from code behind c#

c#,asp.net,newline

data.Controls.Add(new LiteralControl("<br/>")); Add this for new line...

Split data into a new line in oracle but in the same row

sql,oracle,newline

You could replace the split-character "," with a linefeed character. WITH sample_data AS ( select null as ColumnA , 'King' as ColumnB , 'Dog,Cat' as ColumnC FROM dual ) SELECT ColumnA , ColumnB , REPLACE(ColumnC,',',CHR(10)) FROM sample_data ...

Gradle error - expecting anything but ''\n''; got it anyway

compiler-errors,gradle,line,newline,expected-exception

oh oh.. I scratched my head a lot for a misplaced " or ' or } or { or brackets but forgot one simple thing. /Alway run tests This above COMMENT line should have been like the following i.e. I was missing a /. //Alway run tests ...

Can't remove all newlines from a string - last one still remains

php,regex,newline

\s$ Try this.Replace by empty string. \s+|\s$ ...

VB.NET New Line not working

vb.net,string,newline

Try adding one of these to you if: Ch <> vbLf Or Ch <> ChrW(10) I believe it'll work while reading a RichTextBox input. EDIT Private Sub ButtonClick_Click(sender As Object, e As EventArgs) Handles ButtonClick.Click Dim Log As RichTextBox = New RichTextBox() Log.Text = "<iframe class=""goog-te-menu-frame skiptranslate"" src=""javascript:void(0)"" frameborder=""0"" style=""display:...

printf(“%s\n”) output differs from printf(“%s”)

c,arrays,char,printf,newline

Change this: else { word[i] = '\0'; printf("%s\n", word); } To this: else if (i > 0) { word[i] = '\0'; printf("%s\n", word); i = 0; } In order to skip cases of 2 or more consecutive non-alphabetic characters....

Xml Document Transform to find and replace values

.net,xml,newline,xdt-transform,xdt

What you are looking for is WHITESPACE PRESERVE function of XmlDocument described here https://msdn.microsoft.com/en-us/library/system.xml.xmldocument.preservewhitespace%28v=vs.110%29.aspx Second (and best) approach is to let XML decode automatically. You are using the wrong method to read out the select statement ;)...

Why doesn't `“hello\r”.chomp('')` remove `“\r”`?

ruby,newline

If $/ is an empty string, it will remove all trailing newlines from the string. Exactly. \r AKA CR is not a newline character. It's a carriage return character (doesn't start a new line). As to why chomp('') removes CRLF, it's because CRLF is a Windows-style newline. Linux uses...

Selenium IDE: How to verify Contents when it contains a mix of tags and
breaks

javascript,selenium,ide,newline

I'm making some assumptions in answering this question. It sounds like your goal is to validate the contents of var_2. Stripping out the newline is a means to an end. There are other ways to accomplish this though. Why don't you try to create a variable called "expected_var_2_value", and set...

C++ cross-compile not handling newline input text file

c++,newline,cross-compiling

Well, Thank you to Martin Schlott who tried my program on his compiler and it worked with text files from either Windows or Linux sources. This pointed me to the compiler differences and that was the key. The cross-compiler installed by apt-get install mingw32 put an older compiler (v4.2.1) for...

new line in ajax post json data

ajax,json,post,newline

What I think you really want to do is stringify() your object first and then pass that as the data parameter. var data = { id: ($('#idAttribute').val() ? $('#idAttribute').val() : null), repId: $('#repId').val(), scheduleDate: $('#scheduleDate').val(), scheduleTime: $('#scheduleTime').val(), message: $('textarea#message').val() }; $.ajax({ headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, type: 'POST',...

Streams, chars, and newlines

c++,newline,ostream

use getline() get every line int the char *

why after looping there's a newline

c,newline,counter,scanf

On the 2nd time through the loop, scanf("%c",&penal1); is scanning in the '\n' from the previous user input. Add a preceding space like code used in other places to consume all preceding white-space. scanf(" %c",&penal1); // added space. Code should check not only for 'O' and 'o', but 'X' and...