Questions tagged [stringreader]
84 questions
0
votes
3 answers
StringReader.ReadLine clears the given string, is there chance to not clean the string?
When I am using StringReader.ReadLine to read text from array of strings, it reads it perfectly but it also clears my array,
using (StringReader reader = new StringReader(filesGroupList[x]))
{
while ((filesGroupList[x] =…
![](../../users/profiles/1729349.webp)
inside
- 2,609
- 7
- 42
- 68
0
votes
4 answers
Java - write multiline string to file
I have a string with multilines in it as shown below
Harry Potter
how do I write this to a file? I have tried with buffered…
![](../../users/profiles/1482566.webp)
shockwave
- 2,466
- 7
- 25
- 49
0
votes
5 answers
Reading and Writing from a txt file?
I am creating a game with c# and i have occurred a problem. I want my game to save curtain labels to a txt file here ill give you a example:
Label1.Text = "Character Name: "
Label2.Text = "Level: "
Label3.Text = "Exp: "
Now what i wanted to do was…
![](../../users/profiles/1887777.webp)
Terrii
- 365
- 4
- 8
- 23
0
votes
1 answer
Java terminates at an if statement, exit value 0
I have a program that reads in lines from a file (with two lines) using a while loop (condition is bufferedReader.readLine()!=null), assigns myJSONObject a JSON read from the file, then I have an if statment…
![](../../users/profiles/1075247.webp)
Pureferret
- 6,477
- 14
- 72
- 149
0
votes
3 answers
Reading a string with new lines from console java
I want to read this string (from console not file) for example:
one two three
four five six
seven eight nine
So I want to read it per line and put every line in an array.
How can I read it? Because if I use scanner, I can only read one line or one…
![](../../users/profiles/1253201.webp)
user1253201
- 91
- 2
- 4
- 8
-1
votes
2 answers
Java KeyPressed for all keys
In java I'm making an application that, when activated (if wantCommand = true), it will read what ever key you press it reads and adds it to a string, and then using Java.awt.Graphics, it draws the string to the screen... Can someone help me with…
![](../../users/profiles/3167255.webp)
Bryce Hahn
- 63
- 1
- 9
-1
votes
1 answer
Search in a file and write the matched content to another file
I have a large txt file and want to search through it and output certain strings, for example, let's say two lines are:
oNetwork.MapNetworkDrive "Q:", xyz & "\one\two\three\four"
oNetwork.MapNetworkDrive "G:", zzz
From this I'd like to copy and…
![](../../users/profiles/512628.webp)
user512628
- 129
- 2
- 9
-2
votes
2 answers
XmlReader creates empty string C#
I am using StringReader to read an xml stream and then I want to read that stream as XML to Serialize and Desiarilize it.
Although it was working fine for some reason my XmlReader variable returns null.
The XML as I see is the same as before.
My…
![](../../users/profiles/7054211.webp)
rippergr
- 138
- 2
- 13
-4
votes
3 answers
How to get a certain string from text. C#
So i am trying to make a minecraft launcher but it won't log in to server's because my account is migrated to Mojang so i log in with my email instead of my username but there is a way to get my username so i have found out how but i need to get a…
![](../../users/profiles/1887777.webp)
Terrii
- 365
- 4
- 8
- 23