comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

vs code スニペットで $ 記号を入力する方法

vs code スニペット(自動入力)設定ファイル中で $ 記号を入力する方法。 $ のかわりに $$ と入力すればよい。 参考リンク https://stackoverflow.com/questi …

no image

PHPで文字を入れ替える方法

文字を入れ替えるには、strtr を使う。 例 $string = “あいうえお” ; $string1 = “あえ”; $string2 = “かけ”; // 入れ替える echo strtr($s …

no image

c++ で std::vector を宣言時に初期化する方法

std::vector を宣言時に初期化することができる。 コンパイル時に、–std=c++11 のオプションを指定する。 例 #include <iostream> #includ …

no image

python3 で、ある文字列で始まるかどうか判定する方法

文章が、ある文字列で始まるかどうかを判定するには startswith を使う。 例 str = “こんにちは。” print(str.startswith(‘こん’)) print(str.star …

no image

python3 で、文字列の末尾の文字を削除する方法

[:-1] で、最後の文字を取り除いた文字列を取得することができる。 例 str1 = “こんにちは。” result = str1[:-1] print(result) 結果 こんにちは