代码之家  ›  专栏  ›  技术社区  ›  Matt Sephton

编程语言参考:字符串替换[关闭]

  •  0
  • Matt Sephton  · 技术社区  · 15 年前

    我在看是否值得创建一个参考来演示如何在多种编程语言中执行常见操作。

    请在下面列出用您选择的编程语言实现以下目的的命令:

    字符串替换

    实例:

    PHP:

    mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
    

    ObjultC:

    - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
    
    2 回复  |  直到 15 年前
        1
  •  2
  •   jesper Aaron Saunders    15 年前

    爪哇:

    String replaceAll(String regex, String replacement)
    
        2
  •  1
  •   Learning    15 年前

    TSQL

    REPLACE ( string_expression , string_pattern , string_replacement )