問題タブ [stringreader]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
3 に答える
4128 参照

java - Javaのstringreaderを使用して、文字列の次の文字を取得するにはどうすればよいですか?

このコードを考えてみましょう:

私が探しているのは、最初に現在の位置にある文字を調べ、次にその文字が「)」でない場合は文字列に追加するforループです。ただし、文字「)」も文字列に追加する必要があります。この例では、出力は次のようになります。

文字列の結果は次のとおりです:(私の名前はボブです)

0 投票する
3 に答える
3051 参照

c# - Append Text with StringReader (After reader.ReadLine())

Right now I'm building a game application using c#, which will require loading from text file for the game script. (It's quite a simple visual novel game)

Now when the main form loads, i load the script from the file script.txt And i declared :

as a global variable there

Now in the middle of the game where the reader is in the middle of the string script, I need to append starting from next line of the reader. Basically what I want to achieve:

Append all texts from "news.txt" to script starting from reader.ReadLine() [i.e. in the middle of the string script]

What will be the most efficient solution to achieve this?

What I know:

Edit for more clarification (sorry, this is my first time asking here) : I will try to explain more about what i'm trying to achieve here. What i'm having right now :

One possible way (and i think it's the worst way as well) is by introducing one count variable, to get the starting position of the last reader.ReadLine(), and execute the desired result using Insert like follows : script = script.Insert(startIndex, news)

0 投票する
2 に答える
1093 参照

asp.net-mvc - StringReader ASP.NET MVC アプリケーションを使用した textarea 要素からの読み取り

データ変換を実行するために、html textarea 要素から読み取ろうとしています。

私のテキストエリアコード

このメソッドに実装しようとしています

txtArea.Textしかし、どのように実装するのかという各インスタンスでエラーが発生しますか?

エラー: textArea は現在のコンテキストに存在しません

コードを表示

ここに画像の説明を入力

私が達成しようとしているのは、変換ボタンをクリックして、テキストエリア内のテキストをpdfファイルに変換することです。

0 投票する
5 に答える
3303 参照

c# - C# 文字列内の特定の値を読み取る

文字列から次の行があります。

colors numResults="100" totalResults="6806926"

上記の文字列から値を抽出したいのですが6806926、どうすれば可能ですか?

これまで、StringReader を使用して文字列全体を 1 行ずつ読み取ってきました。じゃあどうすればいいの?

0 投票する
3 に答える
2254 参照

java - StringReader の改行文字 - \n は無視されますか?

私はこのコードを持っています:

私はそれが2行を印刷することを期待していました。しかし、それはすべて1行で表示されます。このコードに何か問題がありますか?

0 投票する
10 に答える
30183 参照

java - StringReader を String に変換するにはどうすればよいですか?

StringReader次のように、背中を通常のに変換しようとしてStringいます。

しかし、この文字列を読み込もうとすると、次のようになります。

私が得るのは、次のようなポインター値だけです。

文字列を読み返す際に何か間違ったことをしていますか?

0 投票する
2 に答える
1288 参照

arrays - .CSV ファイルのヘッダー行以外をすべて読み取る方法は?

.csv ファイルを配列に読み込む必要がありますが、.csv ファイルの最初の行を配列に入れたくありません。どうすれば除外できますか?