Out of Memory

本ブログは更新を停止しました。Aerieをよろしくお願いいたします。

目次

Blog 利用状況

ニュース

2009年3月31日
更新を停止しました。引き続きAerieを御愛顧くださいませ。
2009年2月3日
原則としてコメント受付を停止しました。コメントはAerieまでお願いいたします。
詳細は2月3日のエントリをご覧ください。
2008年7月1日
Microsoft MVP for Developer Tools - Visual C++ を再受賞しました。
2008年2月某日
MVPアワードがVisual C++に変更になりました。
2007年10月23日
blogタイトルを変更しました。
2007年7月1日
Microsoft MVP for Windows - SDKを受賞しました!
2007年6月20日
スキル「ニュース欄ハック」を覚えた!
2006年12月14日
記念すべき初エントリ
2006年12月3日
わんくま同盟に加盟しました。

カレンダー

中の人

αετο? / aetos / あえとす

シャノン? 誰それ。

顔写真

埼玉を馬鹿にする奴は俺が許さん。

基本的に知ったかぶり。興味を持った技術に手を出して、ちょっと齧りはするものの、それを応用して何か形にするまでは及ばずに飽きて放り出す人。

書庫

日記カテゴリ

String.LastIndexOfの仕様

さっぱり仕様がわかりません。第2および第3引数の意味を誰か教えてくださいorz

投稿日時 : 2007年9月21日 13:13

Feedback

# re: String.LastIndexOfの仕様 2007/09/21 13:24 とりこびと

これですか?
http://msdn2.microsoft.com/ja-jp/library/ms224421(VS.80).aspx

・・・なんだこれwややこしw

startIndex から count の文字数分前のトコまでが検索範囲?w

# re: String.LastIndexOfの仕様 2007/09/21 13:26 επιστημη

String.LastIndexOf(target, start, count)
start番目からのcount個の文字を検索の対象にすっぞ!
...って意味ちゃうんかなー

# re: String.LastIndexOfの仕様 2007/09/21 13:39 Tom Yama

こうかな?

1. startIndexの位置で比較する
2. 一致したら、終了
3. startIndexとcountとを、1減らす
4. countが0なら、終了
5. 1.に戻る

# re: String.LastIndexOfの仕様 2007/09/21 13:43 επιστημη

public class Program {
  public static void Main() {
  string source = "01234567890123456789";
  char target = '8';
  int start = 10;
  int count = 10;
  int result = source.LastIndexOf(target, start, count);
  System.Console.WriteLine(result);
 }
}

8が返ってまいりました。
start位置からcount個遡りますですねー
んなわけで とりこびっち がせーかい。

# re: String.LastIndexOfの仕様 2007/09/21 13:54 囚人

>8が帰ってまいりました。

なぬっ!?
じゃあ、原文から間違ってるジャン?

# re: String.LastIndexOfの仕様 2007/09/21 14:01 επιστημη

この検索は、startIndex の文字位置から開始し、
value が見つかるか、
count の文字位置に到達するまで、← ここがウソ♪
逆方向に検索を実行します。

The search begins at the startIndex character position
and proceeds backwards until either
value is found or
count character positions have been examined.

原文では"count個の文字位置を調べ尽くすまで"だな。
翻訳のマチガイですねー

# re: String.LastIndexOfの仕様 2007/09/21 14:04 とりこびと

startIndex から検索方向にcountするのか、文字列方向なのか、ですね。

>逆方向に検索を実行します。

コレが混乱するw

# re: String.LastIndexOfの仕様 2007/09/21 14:09 シャノン

あー。
startIndex が指す文字も検索対象になるのかー。

ん…そーすっとアレもまずいな。直しとこう。

# re: String.LastIndexOfの仕様 2007/09/21 14:22 シャノン

まとめ。

●ArgumentOutOfRangeExceptionが出る条件
・startIndex + 1 - count < 0
・startIndex >= string.Length

●このメソッドの挙動
startIndexが指す文字を含め、そこから前にcount文字を検索対象とする。
例:
CABを検索対象とするため見つからない。
"ABCABC".LastIndexOf("ABC", 4, 3 ) -> -1

後ろの ABC が検索対象となる。
"ABCABC".LastIndexOf("ABC", 5, 3 ) -> 3

# re: String.LastIndexOfの仕様 2007/09/21 14:24 囚人

いや、ArgumentOutOfRangeException の Condition
「count plus startIndex specify a position that is not within this instance. 」
が。

つか、今まで完全に間違ってたかも。

startIndex →→→→ startIndex + count
で、count から逆方向に探すと思って…。

# re: String.LastIndexOfの仕様 2007/09/21 14:29 επιστημη

あー、そこか。確かに。
startIndexからcount回'逆方向'に検索すんだから、
「startIndex - count がマイナスになったら例外throw」がせーかいなのかな。

# re: String.LastIndexOfの仕様 2007/09/21 14:35 シャノン

> count plus startIndex specify a position that is not within this instance.

英語の MSDN では、そう書いてあるところは見当たらないけど…
でも、英語の例外ドキュメントもめちゃくちゃ。

http://msdn2.microsoft.com/en-us/library/0w96zd3d.aspx
ArgumentNullExceptionが書いてあるけど、char が null ってあり得るの?

http://msdn2.microsoft.com/en-us/library/1tw91fa3.aspx
startIndex is less than zero or greater than the length of this instance.
実際には startIndex >= length で落ちます。

http://msdn2.microsoft.com/en-us/library/ms131439.aspx
startIndex or count is less than zero or greater than the length of this instance.
もう何言ってんだかわかりません。

別の問題もあるみたい…
http://d.hatena.ne.jp/melt_slinc/20061122

# re: String.LastIndexOfの仕様 2007/09/21 14:41 シャノン

> 「startIndex - count がマイナスになったら例外throw」がせーかいなのかな。

ううん。
startIndex = 5 のとき、文字列の先頭までは 6 文字あるので、count > 6 だと落ちます。
startIndex - count >= -1 までは許容範囲。

# re: String.LastIndexOfの仕様 2007/09/21 14:45 囚人

うっひょ~。混乱してきたぁ!

http://msdn2.microsoft.com/en-us/library/d0z3tk9t(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/d0z3tk9t.aspx

# re: String.LastIndexOfの仕様 2007/09/21 14:49 囚人

衝撃の事実!
URL の末尾が無印なら最新!?

http://msdn2.microsoft.com/ja-jp/library/d0z3tk9t.aspx

# re: String.LastIndexOfの仕様 2007/09/21 14:51 シャノン

うおぉぉぉorz
(VS.80)が英語版も間違えてやがったのか…
そりゃローカライズチームを責めるのは酷ってものか。

# re: String.LastIndexOfの仕様 2007/09/21 15:15 とりこびと

>衝撃の事実!
>URL の末尾が無印なら最新!?

>http://msdn2.microsoft.com/ja-jp/library/d0z3tk9t.aspx

まるで今指摘されて書き直したようなwwww

# re: String.LastIndexOfの仕様 2007/09/21 15:17 επιστημη

なんだかなー

でもでも、
インスタンスの startIndex の文字位置から開始し、value が見つかるか、"count の文字位置に到達するまで"、インスタンスの先頭へ向かって逆方向に検索を実行します。

んとこは依然マチガイよねぇ?
countは'位置'じゃなく'数'だもん。

# re: String.LastIndexOfの仕様 2007/09/21 15:29 シャノン

原文も紛らわしいが、正しくは「count個の文字位置を調べるまで」のようですね。

count character positions have been examined.

# re: String.LastIndexOfの仕様 2007/09/21 15:35 シャノン

というか概要とか引数の説明にはちゃんと書いてある。

> 検索は指定した文字位置から開始され、指定した数の文字位置が検査されます。

> count
> 検査する文字位置の数。

「文字位置の数」ってのがややこしいね。「文字数」でいいじゃないの。

epiさんの意見を反映して投稿しときました。
http://forums.microsoft.com/MSDN-JA/ShowPost.aspx?PostID=2170967&SiteID=7

# re: String.LastIndexOfの仕様 2007/09/21 15:45 επιστημη

「文字位置の数」ってのがややこしいね。「文字数」でいいじゃないの。

str.LastIndexOf("ABC",...)
てーときに「文字数」では余計にわけわからんってことでわないかと。

# GLkhCSVqBohkDUBL 2011/09/29 11:21 http://oemfinder.com

2n1UYb Current blog, fresh information, I read it from time to time!!...

# oWEGIKTNRVcf 2011/10/06 0:21 http://www.cpc-software.com/products/Download-Micr

Honestly, not bad news!...

# HNcxuhWiCUUuVQ 2011/11/02 5:30 http://www.pharmaciecambier.com/

I do`t see a feedback or the other coordinates from the blog administration!...

# GlRyPxUpJrntcPqG 2011/11/02 6:25 http://optclinic.com/

Every time I come back here again and don`t get disappointed..!

# tRJJfXnXIwURk 2011/11/09 6:28 http://www.noteletrackpaydayloansnofax.com/

52. "The road will be overcome by that person, who goes." I wish you never stopped and be creative - forever..!

# iXNeEXyRlYTHzsU 2011/11/16 3:01 http://www/circalighting.com/applications/Webblogm

Extremely easy by words but in reality?, a lot of things don`t correspond. Not everything is so rosy..!

# oeWisXMMYEHdsTmtNI 2011/11/16 4:46 http://www.hooksandlattice.com/garden-table.html

Sometimes I also see something like this, but earlier I didn`t pay much attention to this!...

# CinZstioYxQelDvjYe 2011/12/26 23:37 http://www.discreetpharmacist.com/ger/index.asp

It's straight to the point! You could not tell in other words! :D

# JJuiXykCjygBCSoQraZ 2011/12/27 0:19 http://www.discreetpharmacist.com/ger/index.asp

Sometimes I also see something like this, but earlier I didn`t pay much attention to this!...

# UxHWHHKyXsIh 2011/12/27 6:31 http://www.67wine.com/

Thanks for all the answers:) In fact, learned a lot of new information. Dut I just didn`t figure out what is what till the end!...

# the tao of badass pdf 2014/06/13 0:40 http://sharpdetails.com/wp-includes/TaoOfBadass.ht

Hello just happened upon your website from Google after I entered in, "%BLOGTITLE%" or perhaps something similar (can't quite remember exactly). Anyways, I'm grateful I found it simply because your content is exactly what I'm searching for (writing a college paper) and I hope you don't mind if I collect some information from here and I will of course credit you as the source. Thanks for your time.
the tao of badass pdf http://sharpdetails.com/wp-includes/TaoOfBadass.html

# the venus factor pdf 2014/06/20 3:39 http://destinationornot.com/wp-includes/thevenusfa

Hello! I was interested to know if setting up a blog website such your own: %BLOGURL% is hard to do for inexperienced people? I've been wanting to develop my own website for a while now but have been turned off mainly because I've always assumed it required tons of work. What do you think? Many thanks
the venus factor pdf http://destinationornot.com/wp-includes/thevenusfactor.htm

# احمد كل عام ونت طيب شكراا يابطل 2018/03/29 17:47 احمد كل عام ونت طيب شكراا يابطل

???? ?? ??? ??? ??? ????? ?????

# se o cara ta mostrando como baixa como nao existe?? se vc é burro é outra historia 2018/03/29 22:01 se o cara ta mostrando como baixa como nao existe?

se o cara ta mostrando como baixa como nao existe??
se vc é burro é outra historia

# Its such as you learn my thoughts! You appear to grasp a lot approximately this, such as you wrote the guide in it or something. I feel that you just can do with some p.c. to force the message home a bit, but other than that, that is excellent blog. A 2018/04/02 20:03 Its such as you learn my thoughts! You appear to g

Its such as you learn my thoughts! You appear to grasp a lot approximately this, such
as you wrote the guide in it or something. I feel that you just
can do with some p.c. to force the message home a bit, but
other than that, that is excellent blog. A great read.
I will definitely be back.

# A linguagem conduz à socialização das ações. 2018/04/08 21:50 A linguagem conduz à socialização d

A linguagem conduz à socialização das ações.

# My brother recommended I might like this website. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks! 2018/04/15 13:43 My brother recommended I might like this website.

My brother recommended I might like this website.
He was totally right. This post actually made my day.

You can not imagine just how much time I had spent for this information! Thanks!

# We are a bunch of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You've performed an impressive job and our whole community will be thankful to you. 2018/04/16 10:39 We are a bunch of volunteers and opening a new sch

We are a bunch of volunteers and opening a new scheme in our community.
Your web site offered us with valuable info to work on.
You've performed an impressive job and our whole community will be thankful to you.

# Hey there just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Chrome. I'm not sure if this is a format issue or something to do with internet browser compatibility but I thought I'd post to let you 2018/04/29 6:29 Hey there just wanted to give you a quick heads up

Hey there just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Chrome.
I'm not sure if this is a format issue or something to do with internet browser compatibility
but I thought I'd post to let you know. The style and design look great though!
Hope you get the problem solved soon. Kudos

# What's up friends, pleasant article and fastidious arguments commented here, I am genuinely enjoying by these. 2018/04/29 10:51 What's up friends, pleasant article and fastidious

What's up friends, pleasant article and fastidious arguments commented here, I am genuinely enjoying by these.

# Hi there, after reading this remarkable paragraph i am too happy to share my know-how here with mates. 2018/05/13 1:53 Hi there, after reading this remarkable paragraph

Hi there, after reading this remarkable paragraph i am too
happy to share my know-how here with mates.

# Your style is unique compared to other folks I have read stuff from. Many thanks for posting when you have the opportunity, Guess I will just book mark this site. 2018/05/14 16:59 Your style is unique compared to other folks I hav

Your style is unique compared to other folks I have read stuff from.
Many thanks for posting when you have the opportunity, Guess
I will just book mark this site.

# It's nearly impossible to find experienced people on this topic, however, you sound like you know what you're talking about! Thanks 2018/06/30 19:15 It's nearly impossible to find experienced people

It's nearly impossible to find experienced people on this topic,
however, you sound like you know what you're talking about!

Thanks

# A person necessarily lend a hand to make seriously posts I might state. That is the very first time I frequented your website page and thus far? I surprised with the analysis you made to create this actual put up incredible. Wonderful job! 2018/09/16 6:18 A person necessarily lend a hand to make seriously

A person necessarily lend a hand to make seriously posts I
might state. That is the very first time I frequented your
website page and thus far? I surprised with the analysis
you made to create this actual put up incredible. Wonderful job!

# I was suggested this website by my cousin. I'm not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are wonderful! Thanks! 2018/10/01 16:47 I was suggested this website by my cousin. I'm not

I was suggested this website by my cousin. I'm not sure whether this post is written by him as nobody else know such detailed about my difficulty.
You are wonderful! Thanks!

# Helpful information. Lucky me I found your website accidentally, and I'm shocked why this twist of fate did not took place earlier! I bookmarked it. 2019/03/08 9:56 Helpful information. Lucky me I found your website

Helpful information. Lucky me I found your website accidentally, and I'm shocked
why this twist of fate did not took place earlier! I bookmarked it.

# Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I used to pay a quick visit this blog every day. 2019/07/08 15:41 Hi everybody, here every person is sharing these f

Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I
used to pay a quick visit this blog every day.

# Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I used to pay a quick visit this blog every day. 2019/07/08 15:42 Hi everybody, here every person is sharing these f

Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I
used to pay a quick visit this blog every day.

# Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I used to pay a quick visit this blog every day. 2019/07/08 15:43 Hi everybody, here every person is sharing these f

Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I
used to pay a quick visit this blog every day.

# Everyone loves what you guys are usually up too. This kind of clever work and reporting! Keep up the amazing works guys I've added you guys to blogroll. 2022/03/25 0:21 Everyone loves what you guys are usually up too. T

Everyone loves what you guys are usually up too.
This kind of clever work and reporting! Keep up the
amazing works guys I've added you guys to blogroll.

# Everyone loves what you guys are usually up too. This kind of clever work and reporting! Keep up the amazing works guys I've added you guys to blogroll. 2022/03/25 0:22 Everyone loves what you guys are usually up too. T

Everyone loves what you guys are usually up too.
This kind of clever work and reporting! Keep up the
amazing works guys I've added you guys to blogroll.

# Everyone loves what you guys are usually up too. This kind of clever work and reporting! Keep up the amazing works guys I've added you guys to blogroll. 2022/03/25 0:23 Everyone loves what you guys are usually up too. T

Everyone loves what you guys are usually up too.
This kind of clever work and reporting! Keep up the
amazing works guys I've added you guys to blogroll.

# Artigo muito bom, apresenta muito bem as informações, é o que verdadeiramente interessa. Este site está de parabéns. Vale a pena ler na integra. 2022/09/09 0:18 Artigo muito bom, apresenta muito bem as informa&

Artigo muito bom, apresenta muito bem as informações, é o que verdadeiramente interessa.
Este site está de parabéns. Vale a pena ler na integra.

# eu adoro quando me deparo com artigos tão bem redigidos quanto o que pude encontrar aqui . Continuarei visitando seu site já que adorei dos seus artigos . 2022/09/11 5:45 eu adoro quando me deparo com artigos tão bem

eu adoro quando me deparo com artigos tão bem redigidos quanto o que pude encontrar aqui .

Continuarei visitando seu site já que adorei dos seus
artigos .

タイトル
名前
Url
コメント